Add PEP 741 PyInitConfig API to the limited C API
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 77.2k
- Forks
- 35.9k
- PR merge metrics
- PR metrics pending
Description
The GDB project would be interested to use the limited C API to embed Python. Some APIs used by GDB are missing from the limited C API (well, it's limited ;-)), one of them is the PEP 741 PyInitConfig API.
I propose adding PEP 741 PyInitConfig API to the limited C API.
PEP 741 Rationale lists other projects embedding Python. More projects would benefit from PyInitConfig being in the limited C API.
For example, the vim text editor uses dlopen/dlsym and GetProcAddress on Windows to get Python symbols at runtime. The libpython library is loaded on demand (at the first Python usage). vim already supports the stable ABI. See src/if_python3.c.
So far, I found pyinstaller which already adopted the PyInitConfig API.
Linked PRs
- gh-149194
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
Read PEP 741's embedding rationale and inspect Vim's src/if_python3.c to understand the limited-ABI use case. Then review linked PR gh-149194 and the limited C API work; done means PyInitConfig is available through that API for projects embedding Python.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c, python
- Domain
- api, backend
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100