mirror of
https://github.com/python/cpython.git
synced 2025-11-25 04:34:37 +00:00
bpo-32018: Fix inspect.signature repr to follow PEP 8 (#4408)
This commit is contained in:
parent
f8a4c03ede
commit
762b9571c9
4 changed files with 10 additions and 5 deletions
|
|
@ -2521,11 +2521,14 @@ class Parameter:
|
|||
|
||||
# Add annotation and default value
|
||||
if self._annotation is not _empty:
|
||||
formatted = '{}:{}'.format(formatted,
|
||||
formatted = '{}: {}'.format(formatted,
|
||||
formatannotation(self._annotation))
|
||||
|
||||
if self._default is not _empty:
|
||||
formatted = '{}={}'.format(formatted, repr(self._default))
|
||||
if self._annotation is not _empty:
|
||||
formatted = '{} = {}'.format(formatted, repr(self._default))
|
||||
else:
|
||||
formatted = '{}={}'.format(formatted, repr(self._default))
|
||||
|
||||
if kind == _VAR_POSITIONAL:
|
||||
formatted = '*' + formatted
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue