The Python C API should only define macros with a name starting wit `Py`
Open
Nobody has claimed this yet.
infra
topic-C-API
- Dominant language
- Python
- Stars
- 77.2k
- Forks
- 35.9k
- PR merge metrics
- PR metrics pending
Description
Currently, the Python C API defines 472 macros with a name which doesn't start with Py, PY, _Py or _PY prefix.
I propose adding a check to prevent adding new macros which doesn't respect this convention. Existing invalid names will be added to an ignore list for now.
Linked PRs
- gh-157696
- gh-157752
- gh-157821
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 by reviewing linked PRs gh-157696 and gh-157752, then trace how the Python C API macros are currently checked. Done means new macros without a Py, PY, _Py, or _PY prefix are rejected while the existing invalid names are covered by an ignore list.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c, python
- Domain
- api
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100