Skip to content

Conversation

@encukou
Copy link
Member

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).

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).
@encukou
Copy link
MemberAuthor

encukou commented Apr 29, 2021

The page, rendered on RTD: https://cpython-devguide--682.org.readthedocs.build/c-api/

@erlend-aasland, you wrote Include/README.rst. Does this PR look OK to you?

Note that I also want to improve Doc/c-api/stable.rst: python/cpython#25668

encukou added a commit to encukou/cpython that referenced this pull request Apr 29, 2021
Copy link
Contributor

@erlend-aaslanderlend-aasland left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, the "follow standard C" part is covered in line 130.

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.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe drop "normally"?

Copy link
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

By normally I mean without defining macros to select the other variants. I'll expand that in the section below.

@encukou
Copy link
MemberAuthor

Thanks for the comments!
Do things look better now?

Copy link
Contributor

@erlend-aaslanderlend-aasland left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM :)

@encukouencukou merged commit 9b6b939 into python:masterMay 4, 2021
@encukouencukou deleted the c-api branch May 4, 2021 15:21
@encukou
Copy link
MemberAuthor

Thanks!

@vstinner
Copy link
Member

https://devguide.python.org/c-api/ is great, thanks @encukou!

Next step: document C API removal ;-)

AA-Turner pushed a commit to AA-Turner/devguide that referenced this pull request Jun 17, 2022
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. On top of that, I addes points from PEP 652 (Maintaining the Stable ABI). Co-Authored-By: Erlend Egeberg Aasland <[email protected]>
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@encukou@vstinner@erlend-aasland@the-knights-who-say-ni