This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Make inspect.signature able to parse format strings.
Type: enhancement Stage:
Components: Library (Lib) Versions: Python 3.9
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: Antony.Lee, FFY00, eric.smith
Priority: normal Keywords:

Created on 2020-05-01 15:20 by Antony.Lee, last changed 2022-04-11 14:59 by admin.

Messages (1)
msg367852 - (view) Author: Antony Lee (Antony.Lee) * Date: 2020-05-01 15:20
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).
History
Date User Action Args
2022-04-11 14:59:30adminsetgithub: 84650
2020-05-03 01:23:54FFY00setnosy: + FFY00
2020-05-01 16:29:40brett.cannonsettype: enhancement
2020-05-01 16:29:34brett.cannonsetcomponents: + Library (Lib)
2020-05-01 15:23:46eric.smithsetnosy: + eric.smith
2020-05-01 15:20:47Antony.Leecreate