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 — Add `PyType_GetBaseByToken` function with `Py_tp_token` slot · Issue #124153 · python/cpython

Add PyType_GetBaseByToken function with Py_tp_token slot #124153

New issue
Copy link
New issue
Copy link
Closed
Closed
Add PyType_GetBaseByToken function with Py_tp_token slot#124153
Copy link
Labels
type-featureA feature request or enhancementA feature request or enhancement

Description

@neonene
neonene
opened on Sep 17, 2024
Issue body actions

This issue implements a proposal related to PEP-489 and PEP-630.

Decision:

  • Add Py_tp_token slot and PyType_GetBaseByToken function capi-workgroup/decisions#34

TODO:

  • Implement the feature
  • Use it in _PyStgInfo_FromType_NoState() in _ctypes.c
  • Ensure no performance regression in PyType_GetModuleByDef() and other functions affected by this feature on Windows PGO builds

TODO (optional):

  • Replace PyType_GetModuleByDef() in defdict_or() (_collectionsmodule.c)
  • Replace _PyType_GetModuleByDef2() in _decimal.c
  • Remove _PyType_GetModuleByDef2()

Has this already been discussed elsewhere?

I have already discussed this feature proposal on Discourse

Links to previous discussion of this feature:

  • Better support for type checking encukou/abi3#19
  • https://discuss.python.org/t/55598

Linked PRs

  • gh-124153: Introduce PyType_GetBaseByToken function (PoC) #121079
  • gh-124153: Implement PyType_GetBaseByToken() and Py_tp_token slot #124163
  • gh-124153: Remove _PyType_GetModuleByDef2 private function #124261
  • gh-124153: Clean up workarounds for PyType_GetBaseByToken() performance #124323
  • gh-124153: Fix unstable optimization of PyType_GetBaseByToken() and friends #124488
  • gh-124153: Add Py_tp_token support to xxlimited module #141644

Activity

  1. neonene
    added
    type-featureA feature request or enhancementA feature request or enhancement
    on Sep 17, 2024
  2. encukou
    added a commit that references this issue on Sep 18, 2024

    gh-124153: Implement `PyType_GetBaseByToken()` and `Py_tp_token` slot (…

    646f16b
  3. encukou commented on Sep 18, 2024

    @encukou
    encukou
    on Sep 18, 2024
    Member
    More actions

    The first PR is merged. Keeping this open for the other TODO items.

    Reacted by neonene
  4. savannahostrowski
    added a commit that references this issue on Sep 22, 2024

    pythongh-124153: Implement `PyType_GetBaseByToken()` and `Py_tp_token…

    6da8650
  5. encukou
    added a commit that references this issue on Sep 26, 2024

    gh-124153: Remove `_PyType_GetModuleByDef2` private function (GH-124261)

    d7248cd
  6. encukou
    added a commit that references this issue on Oct 10, 2024

    gh-124153: Simplify PyType_GetBaseByToken (GH-124488)

    120b891
  7. neonene commented on Oct 10, 2024

    @neonene
    neonene
    on Oct 10, 2024
    ContributorAuthor
    More actions

    Completed. Thank you for allowing me to follow up.

    Reacted by Victor Stinner
  8. neonene
    closed this as completedon Oct 10, 2024
  9. gpshead
    added 3 commits that reference this issue on Nov 17, 2025

    Add Py_tp_token support to xxlimited module

    3e06b4f

    Add Py_tp_token support to xxlimited module

    d9613e0

    Add Py_tp_token support to xxlimited module

    93b525f
  10. ambv
    added a commit that references this issue on Oct 20, 2026

    Add Py_tp_token support to xxlimited module

    70d23e1
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.