Add a page on changing the C API (PEP-652) #682
Merged
+195
−0
Conversation
This repeats points currently said in `Include/README.rst`. I intend to replace most of that README with a link to this document. The main change from that document are: - The three "rings" are not defined by where things are declared. It would be good to have them in the right place, but it's not yet the case, and for technical reasons we might never reach the ideal. (In `Include/README.rst` it makes more sense to make the locations more prominent.) - The order is switched. For changing the Limited API you generally need to read (and follow guidelines in) the preceding sections as well. I added points from PEP 652 (Maintaining the Stable ABI).
|
The page, rendered on RTD: https://cpython-devguide--682.org.readthedocs.build/c-api/ @erlend-aasland, you wrote Note that I also want to improve |
encukou
added a commit
to encukou/cpython
that referenced
this pull request
Apr 29, 2021
|
LGTM, with some nitpicks :) |
c-api.rst
Outdated
|
|
||
| - Please start a public discussion before expanding the Limited API | ||
|
|
||
| - The limited API and its intended use must follow standard C, not just |
erlend-aasland
Apr 30, 2021
Contributor
Suggested change
| - The limited API and its intended use must follow standard C, not just | |
| - The Limited API and its intended use must follow standard C, not just |
(Nit: I find the "its intended use" part a tiny bit weird. Can it be reformulated?)
| 1. The internal, private API, available with ``Py_BUILD_CORE`` defined. | ||
| Ideally declared in ``Include/internal/``. Any API named with a leading | ||
| underscore is also considered private. | ||
| 2. The public C API, available when ``Python.h`` is included normally. |
encukou
May 4, 2021
Author
Member
By normally I mean without defining macros to select the other variants. I'll expand that in the section below.
|
Thanks for the comments! |
|
LGTM :) |
|
Thanks! |
|
https://devguide.python.org/c-api/ is great, thanks @encukou! Next step: document C API removal ;-) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
This repeats points currently said in
Include/README.rst.I intend to replace most of that README with a link to this document.
The main change from that document are:
It would be good to have them in the right place, but it's
not yet the case, and for technical reasons we might never reach
the ideal. (In
Include/README.rstit makes more sense to makethe locations more prominent.)
need to read (and follow guidelines in) the preceding sections
as well.
I added points from PEP-652 (Maintaining the Stable ABI).