Applied some more code simplifications suggested by the new Simplify checker (Y102: use single if) (batch 2+).

Mon, 12 Apr 2021 19:25:18 +0200

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Mon, 12 Apr 2021 19:25:18 +0200
changeset 8229
6fa22aa4fc4a
parent 8228
772103b14c18
child 8230
8b5c6896655b

Applied some more code simplifications suggested by the new Simplify checker (Y102: use single if) (batch 2+).

eric6/QScintilla/DocstringGenerator/PyDocstringGenerator.py file | annotate | diff | comparison | revisions
diff -r 772103b14c18 -r 6fa22aa4fc4a eric6/QScintilla/DocstringGenerator/PyDocstringGenerator.py
--- a/eric6/QScintilla/DocstringGenerator/PyDocstringGenerator.py	Mon Apr 12 19:21:40 2021 +0200
+++ b/eric6/QScintilla/DocstringGenerator/PyDocstringGenerator.py	Mon Apr 12 19:25:18 2021 +0200
@@ -580,11 +580,13 @@
             if equalPosition > -1:
                 hasValue = True
             
-            if colonPosition > -1:
-                if not hasValue or equalPosition > colonPosition:
-                    # exception for def foo(arg1=":")
-                    hasType = True
-            
+            if (
+                colonPosition > -1 and
+                (not hasValue or equalPosition > colonPosition)
+            ):
+                # exception for def foo(arg1=":")
+                hasType = True
+        
             if hasValue and hasType:
                 argName = arg[0:colonPosition].strip()
                 argType = arg[colonPosition + 1:equalPosition].strip()

eric ide

mercurial