-
-
Notifications
You must be signed in to change notification settings - Fork 30.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix inspect.signature() of operator.{attrgetter,itemgetter,methodcaller} instances #118285
Comments
The signatures of the getter/caller classes are the signature of their |
…thodcaller} instances * Allow to specify the signature of custom callable instances of extension type by the __text_signature__ attribute. * Specify signatures of operator.attrgetter, operator.itemgetter, and operator.methodcaller instances.
…ller} instances (GH-118316) * Allow to specify the signature of custom callable instances of extension type by the __text_signature__ attribute. * Specify signatures of operator.attrgetter, operator.itemgetter, and operator.methodcaller instances.
Actually, the Now In any case, I added a simple way to specify signature for callables implemented in C and implemented it for the |
Bug report
Bug description:
On Python 3.12.3 and 3.11.9, it looks like the
inspect.Signature
object for operator'sattrgetter
,itemgetter
, andmethodcaller
classes doesn't match their__call__
method signature:but their
__call__
methods only accept a single argument:CPython versions tested on:
3.11, 3.12
Operating systems tested on:
macOS
Linked PRs
The text was updated successfully, but these errors were encountered: