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 — [Enum] `__text_signature__` of `EnumType.__call__` and derivatives · Issue #100039 · python/cpython

[Enum] __text_signature__ of EnumType.__call__ and derivatives #100039

New issue
Copy link
New issue
Copy link
Closed
Closed
[Enum] __text_signature__ of EnumType.__call__ and derivatives#100039
Copy link
Assignees
ethanfurman
Labels
3.12only security fixesonly security fixesstdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytype-featureA feature request or enhancementA feature request or enhancement

Description

@ethanfurman
ethanfurman
opened on Dec 5, 2022
Issue body actions

EnumType.__call__ is a dual-purpose method:

  • create a new enum class (functional API, and only valid if the parent enum has no members)
  • look up an existing member (only valid if enum has members)

Enhancement: Have the appropriate __text_signature__ set for each enum/flag.

Linked PRs

  • gh-100039: enhance __signature__ to work with str and callables #100168

Activity

  1. ethanfurman
    added
    type-featureA feature request or enhancementA feature request or enhancement
    stdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directory
    3.12only security fixesonly security fixes
    on Dec 5, 2022
  2. ethanfurman
    self-assigned this
    on Dec 5, 2022
  3. ethanfurman commented on Dec 11, 2022

    @ethanfurman
    ethanfurman
    on Dec 11, 2022
    MemberAuthor
    More actions

    Okay, __text_signature__ is not settable on a class (so, for example, not on enum.Enum). It would take some changes in the C code and possibly to internal data structures to make that work.

    So instead I have a patch that augments inspect to be able to properly interpret __signature__ when it is a classmethod that returns a string.

  4. ethanfurman
    added a commit that references this issue on Dec 16, 2022

    gh-100039: enhance __signature__ to work with str and callables (GH-1…

    a5a7cea
  5. ethanfurman
    closed this as completedon Dec 16, 2022
  6. carljm
    added a commit that references this issue on Dec 16, 2022

    Merge branch 'main' into fastmock

    1b6241a
  7. shihai1991
    added a commit that references this issue on Dec 18, 2022

    Merge remote-tracking branch 'origin/main' into bpo_34697

    2878571
  8. heytjr
    added a commit that references this issue on Jul 16, 2025

    Fix test error on Python 3.12

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

Metadata

Metadata

Assignees

  • @ethanfurman
    ethanfurman

Labels

3.12only security fixesonly security fixesstdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytype-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.