eric6/QScintilla/DocstringGenerator/PyDocstringGenerator.py

changeset 8228
772103b14c18
parent 8222
5994b80b8760
child 8229
6fa22aa4fc4a
--- a/eric6/QScintilla/DocstringGenerator/PyDocstringGenerator.py	Mon Apr 12 19:05:23 2021 +0200
+++ b/eric6/QScintilla/DocstringGenerator/PyDocstringGenerator.py	Mon Apr 12 19:21:40 2021 +0200
@@ -581,9 +581,7 @@
                 hasValue = True
             
             if colonPosition > -1:
-                if not hasValue:
-                    hasType = True
-                elif equalPosition > colonPosition:
+                if not hasValue or equalPosition > colonPosition:
                     # exception for def foo(arg1=":")
                     hasType = True
             
@@ -682,9 +680,10 @@
                 self.functionType = "staticmethod"
             elif decorator == "@classmethod":
                 self.functionType = "classmethod"
-            elif re.match(r"@(PyQt[456]\.)?(QtCore\.)?pyqtSlot", decorator):
-                self.functionType = "qtslot"
-            elif re.match(r"@(PySide[26]\.)?(QtCore\.)?Slot", decorator):
+            elif (
+                re.match(r"@(PyQt[456]\.)?(QtCore\.)?pyqtSlot", decorator) or
+                re.match(r"@(PySide[26]\.)?(QtCore\.)?Slot", decorator)
+            ):
                 self.functionType = "qtslot"
         
         text = "".join(textList).strip()

eric ide

mercurial