Skip to content

operator.{itemgetter,attrgetter,methodcaller} don't have signatures #94590

Closed
@eriknw

Description

@eriknw

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:

PR forthcoming.

Metadata

Metadata

Assignees

No one assigned

    Labels

    type-featureA feature request or enhancement

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions