diff options
Diffstat (limited to 'Lib/pydoc.py')
-rwxr-xr-x | Lib/pydoc.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/Lib/pydoc.py b/Lib/pydoc.py index c983cbb..56a47dc 100755 --- a/Lib/pydoc.py +++ b/Lib/pydoc.py @@ -1128,7 +1128,8 @@ class HTMLDoc(Doc): # XXX lambda's won't usually have func_annotations['return'] # since the syntax doesn't support but it is possible. # So removing parentheses isn't truly safe. - argspec = argspec[1:-1] # remove parentheses + if not object.__annotations__: + argspec = argspec[1:-1] # remove parentheses if not argspec: argspec = '(...)' @@ -1581,7 +1582,8 @@ location listed above. # XXX lambda's won't usually have func_annotations['return'] # since the syntax doesn't support but it is possible. # So removing parentheses isn't truly safe. - argspec = argspec[1:-1] # remove parentheses + if not object.__annotations__: + argspec = argspec[1:-1] # remove parentheses if not argspec: argspec = '(...)' decl = asyncqualifier + title + argspec + note |