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()