diff options
Diffstat (limited to 'Lib/inspect.py')
-rw-r--r-- | Lib/inspect.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/Lib/inspect.py b/Lib/inspect.py index 6d6fde9..69f2b62 100644 --- a/Lib/inspect.py +++ b/Lib/inspect.py @@ -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 |