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 6d145ab..9bb64fe 100755 --- a/Lib/pydoc.py +++ b/Lib/pydoc.py @@ -1144,7 +1144,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 = '(...)' @@ -1586,7 +1587,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] if not argspec: argspec = '(...)' decl = asyncqualifier + title + argspec + note |