Static PyModuleDef Objects Should be Immortal
Open
Nobody has claimed this yet.
3.12
extension-modules
interpreter-core
performance
topic-C-API
type-feature
- Dominant language
- Python
- Stars
- 77.2k
- Forks
- 36k
- PR merge metrics
- PR metrics pending
Description
We'd likely do this via PyModuleDef_HEAD_INIT, either directly or indirectly. The indirection might be necessary as PyModuleDef_HEAD_INIT is part of the public C-API, but _PyObject_IMMORTAL_REFCNT is not.
CC @eduardo-elizondo
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.
Research direction
Start with PyModuleDef_HEAD_INIT and the public C-API boundary described in the issue. Determine how static PyModuleDef objects are initialized without exposing _PyObject_IMMORTAL_REFCNT, then verify that the resulting objects are immortal while the public API remains compatible.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- backend
- Issue type
- Refactor
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100