Skip to content

Add PyType_GetBaseByToken function with Py_tp_token slot #124153

Closed
@neonene

Description

@neonene

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

Decision:

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:

Linked PRs

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