mirror of
https://github.com/python/cpython.git
synced 2025-08-22 01:35:16 +00:00
gh-107155: Fix help() for lambda function with return annotation (GH-107401)
This commit is contained in:
parent
664965a1c1
commit
b9a9e3dd62
3 changed files with 31 additions and 2 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue