Repository navigation
gh-141004: Document the remaining parts of the public C API - #159892
Open
ZeroIntensity wants to merge 13 commits into
Open
ZeroIntensity wants to merge 13 commits into
ZeroIntensity wants to merge 13 commits into
Conversation
Documentation build overview
25 files changed ·
|
ZeroIntensity
requested review from
AA-Turner,
StanFromIreland and
hugovk
as code owners
October 20, 2026 17:19
ZeroIntensity
commented
Oct 20, 2026
encukou
reviewed
Oct 20, 2026
encukou
left a comment
Member
There was a problem hiding this comment.
I have a bunch of suggestions for these.
Comment on lines
+164
to
+167
| String literal ``"b"``, which can be appended to a C standard I/O mode | ||
| string, such as ``"r" PY_STDIOTEXTMODE``, to open a file in binary mode. | ||
| This prevents the C library from translating newlines, so that Python can | ||
| perform its own newline translation. |
Member
There was a problem hiding this comment.
Users don't need this in standard C.
Suggested change
| String literal ``"b"``, which can be appended to a C standard I/O mode | |
| string, such as ``"r" PY_STDIOTEXTMODE``, to open a file in binary mode. | |
| This prevents the C library from translating newlines, so that Python can | |
| perform its own newline translation. | |
| The string literal ``"b"``, used to open files in binary mode. | |
| Exposed for backwards compatibility only. | |
| .. soft-deprecated:: next |
Member
There was a problem hiding this comment.
One more thing: there's a "Soft-deprecated API" section just below this, move it there?
Co-authored-by: Petr Viktorin <encukou@gmail.com>
ZeroIntensity
requested review from
corona10,
emmatyping and
itamaro
as code owners
October 20, 2026 22:26
encukou
reviewed
Oct 20, 2026
Co-authored-by: Petr Viktorin <encukou@gmail.com>
encukou
reviewed
Oct 21, 2026
encukou
left a comment
Member
There was a problem hiding this comment.
I don't think you need to check the Expat version.
Comment on lines
+22
to
+28
| its ``magic`` member compares equal to this string using ``strcmp()``, | ||
| its ``size`` member is at least :c:expr:`sizeof(struct PyExpat_CAPI)`, and its | ||
| :c:member:`PyExpat_CAPI.MAJOR_VERSION`, :c:member:`PyExpat_CAPI.MINOR_VERSION`, | ||
| and :c:member:`PyExpat_CAPI.MICRO_VERSION` members equal the | ||
| ``XML_MAJOR_VERSION``, ``XML_MINOR_VERSION``, and ``XML_MICRO_VERSION`` | ||
| macros, respectively, from the :file:`expat.h` header used to build the | ||
| extension. |
Member
There was a problem hiding this comment.
Suggested change
| its ``magic`` member compares equal to this string using ``strcmp()``, | |
| its ``size`` member is at least :c:expr:`sizeof(struct PyExpat_CAPI)`, and its | |
| :c:member:`PyExpat_CAPI.MAJOR_VERSION`, :c:member:`PyExpat_CAPI.MINOR_VERSION`, | |
| and :c:member:`PyExpat_CAPI.MICRO_VERSION` members equal the | |
| ``XML_MAJOR_VERSION``, ``XML_MINOR_VERSION``, and ``XML_MICRO_VERSION`` | |
| macros, respectively, from the :file:`expat.h` header used to build the | |
| extension. | |
| its ``magic`` member compares equal to this string using ``strcmp()`` | |
| and its ``size`` member is at least :c:expr:`sizeof(struct PyExpat_CAPI)`. |
encukou
reviewed
Oct 21, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Almost there!