python / python/cpython

Adjust _Py_MAX_MANAGED_STATIC_BUILTIN_TYPES value automatically

Open
#145,497 10 comments 0 reactions 1 assignee View on GitHub

@corona10 is already working on this.

Since Mar 5, 2026.

interpreter-core topic-C-API type-feature
Dominant language
Python
Stars
77.2k
Forks
35.9k
PR merge metrics
PR metrics pending

Description

When a new built-in type is introduced, _Py_MAX_MANAGED_STATIC_BUILTIN_TYPES needs to be updated accordingly.
(e.g., https://github.com/python/cpython/commit/3e2f5c133f37f13f627404f3cbd54a5fc163887a, https://github.com/python/cpython/pull/145496#issuecomment-3997827812)

This is quite painful, and sometimes we even forget to adjust it. To prevent this kind of issue, we may need a way to update it automatically, or add a test that verifies it is set correctly.

cc @markshannon @Fidget-Spinner @vstinner

Linked PRs
  • gh-149139
  • gh-151004
  • gh-151152
  • gh-157582

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.