New submission from Antony Lee <[email protected]>:
It would be nice if inspect.signature was able to understand bound str.format
methods, e.g. `inspect.signature("{a} {b}".format) == inspect.signature(lambda
*args, a, b, **kwargs: None)` (`*args, **kwargs` are there because str.format
ignores additional arguments). Right now I believe the only way to parse
format strings is string.Formatter, which is slightly less discoverable and
harder to use (although it certainly also provides more info, e.g.
inspect.signature wouldn't be able to tell about format specifiers, but that's
fine).
----------
messages: 367852
nosy: Antony.Lee
priority: normal
severity: normal
status: open
title: Make inspect.signature able to parse format strings.
versions: Python 3.9
_______________________________________
Python tracker <[email protected]>
<https://bugs.python.org/issue40470>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com