Skip to content

Conversation

@ucodery
Copy link
Contributor

@ucodery ucodery commented Apr 14, 2022

Examples from the issue, redone under this commit:

>>> import inspect
>>> def a_test(a=str, b=inspect, c=inspect.Signature, d=inspect.signature, e=inspect.Signature.replace, f=(i for i in range(3))):
...    """lots of objects with awkward reprs"""
...
>>> print(inspect.signature(a_test))
(a=str, b=inspect, c=inspect.Signature, d=inspect.signature, e=inspect.Signature.replace, f=<genexpr>)
>>>
>>> def b_test(a: str = str):
...    """annotations seem to get this right"""
...
>>> print(inspect.signature(b_test))
(a: str = str)
>>> help(locale.atof)
Help on function atof in module locale:

atof(string, func=float)
    Parses a string as a float according to the locale settings.

#91544

@ucodery ucodery changed the title Better stringification of Parameter defaults gh-91544: Better stringification of Parameter defaults Apr 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants