Adjust _Py_MAX_MANAGED_STATIC_BUILTIN_TYPES value automatically
Open
@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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.