GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — operator.{itemgetter,attrgetter,methodcaller} don't have signatures · Issue #94590 · python/cpython

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

New issue
Copy link
New issue
Copy link
Closed
#94591
Closed
operator.{itemgetter,attrgetter,methodcaller} don't have signatures#94590
#94591
Copy link
Labels
type-featureA feature request or enhancementA feature request or enhancement

Description

@eriknw
eriknw
opened on Jul 6, 2022
Issue body actions

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.

Activity

  1. eriknw
    added
    type-featureA feature request or enhancementA feature request or enhancement
    on Jul 6, 2022
  2. JelleZijlstra
    closed this as completedin #94591on Oct 6, 2022
  3. JelleZijlstra
    added a commit that references this issue on Oct 6, 2022

    gh-94590: add signatures to operator itemgetter, attrgetter, methodca…

    1c4728c
  4. carljm
    added 2 commits that reference this issue on Oct 6, 2022

    Merge branch 'main' into dictwatch

    e5d2169

    Merge branch 'main' into typewatch

    415ed49
  5. mpage
    added a commit that references this issue on Oct 11, 2022

    pythongh-94590: add signatures to operator itemgetter, attrgetter, me…

    a9a8f2e
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    type-featureA feature request or enhancementA feature request or enhancement

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402503 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.