Closed
Description
Feature or enhancement
Update the docstrings to operator.itemgetter
, operator.attrgetter
, and operator.methodcaller
so that they will automatically be given __text_signature__
strings so inspect.signature
will give correct signature.
Pitch
These are the only functions in operator
that don't have signatures. operator
functions are often used when programming in a functional style, and sometimes signature inspection is useful to e.g. determine whether a call is valid or whether to curry arguments.
Also, as a user, I find it nice to see accurate text signatures in the docstring and when calling help(func)
.
Previous discussion
These were intentionally skipped when operator
functions were updated to use the argument clinic. See:
- Derby #18: Convert 31 sites to Argument Clinic across 23 files #64385 (comment)
- or https://bugs.python.org/issue20186#msg244971
PR forthcoming.