Skip to content

gh-141004: Document the remaining parts of the public C API - #159892

Merged
encukou merged 14 commits into
python:mainfrom
ZeroIntensity:docs/c-api/the-remaining-stuff
Oct 21, 2026
Merged

encukou merged 14 commits into
python:mainfrom
ZeroIntensity:docs/c-api/the-remaining-stuff

Conversation

@ZeroIntensity

@ZeroIntensity ZeroIntensity commented Oct 20, 2026 •

Copy link
Copy Markdown
Member

Almost there!

@read-the-docs-community

read-the-docs-community Bot commented Oct 20, 2026 •

Copy link
Copy Markdown

Documentation build overview

📚 cpython-previews | 🛠️ Build #35286409 | 📁 Comparing 1ac0d68 against main (f5d989e)

  🔍 Preview build  

26 files changed · + 1 added · ± 25 modified

+ Added

± Modified

Comment thread Doc/conf.py Outdated

@encukou encukou left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I have a bunch of suggestions for these.

Comment thread Doc/c-api/code.rst Outdated
Comment thread Doc/c-api/conversion.rst
Comment thread Doc/c-api/file.rst Outdated
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.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

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

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

One more thing: there's a "Soft-deprecated API" section just below this, move it there?

Comment thread Doc/c-api/hash.rst Outdated
Comment thread Doc/c-api/intro.rst Outdated
Comment thread Doc/c-api/pyexpat.rst Outdated
Comment thread Doc/c-api/pyexpat.rst Outdated
Comment thread Doc/c-api/pyexpat.rst Outdated
Comment thread Doc/c-api/pyexpat.rst Outdated
Comment thread Doc/c-api/pyexpat.rst Outdated
Comment thread Doc/c-api/veryhigh.rst Outdated
Comment thread Doc/c-api/veryhigh.rst Outdated
Comment thread Doc/c-api/veryhigh.rst Outdated
Comment thread Doc/c-api/weakref.rst Outdated
Comment thread Doc/c-api/pyexpat.rst Outdated
@ZeroIntensity
ZeroIntensity requested a review from encukou October 20, 2026 23:32

@encukou encukou left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I don't think you need to check the Expat version.

Comment thread Doc/c-api/pyexpat.rst Outdated
Comment thread Doc/c-api/pyexpat.rst
Co-authored-by: Petr Viktorin <encukou@gmail.com>
@hugovk
hugovk removed their request for review October 21, 2026 05:14
@kumaraditya303
kumaraditya303 removed their request for review October 21, 2026 08:52
@encukou
encukou merged commit 01ff2e2 into python:main Oct 21, 2026
65 checks passed
@encukou

encukou commented Oct 21, 2026

Copy link
Copy Markdown
Member

Thank you!

@miss-islington-app

Copy link
Copy Markdown

Thanks @ZeroIntensity for the PR, and @encukou for merging it 🌮🎉.. I'm working now to backport this PR to: 3.14, 3.15.
🐍🍒⛏🤖

@github-project-automation github-project-automation Bot moved this from Todo to Done in Docs PRs Oct 21, 2026
@github-project-automation github-project-automation Bot moved this from Todo to Done in Sprint Oct 21, 2026
@miss-islington-app

Copy link
Copy Markdown

Sorry, @ZeroIntensity and @encukou, I could not cleanly backport this to 3.14 due to a conflict.

Please backport manually with cherry_picker, see the devguide for more information.

cherry_picker 01ff2e22e158674e68321f204cfb6dca631eda83 3.14

@bedevere-app

bedevere-app Bot commented Oct 21, 2026

Copy link
Copy Markdown

GH-160067 is a backport of this pull request to the 3.15 branch.

@bedevere-app bedevere-app Bot removed the needs backport to 3.15 bugs and security fixes label Oct 21, 2026
@ZeroIntensity
ZeroIntensity deleted the docs/c-api/the-remaining-stuff branch October 21, 2026 17:22
@bedevere-app

bedevere-app Bot commented Oct 21, 2026

Copy link
Copy Markdown

GH-160070 is a backport of this pull request to the 3.14 branch.

@bedevere-app bedevere-app Bot removed the needs backport to 3.14 bugs and security fixes label Oct 21, 2026
ZeroIntensity added a commit that referenced this pull request Oct 21, 2026
…9892) (GH-160070)

(cherry picked from commit 01ff2e2)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
ZeroIntensity added a commit that referenced this pull request Oct 21, 2026
…9892) (GH-160067)

(cherry picked from commit 01ff2e2)

Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
Co-authored-by: Petr Viktorin <encukou@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Documentation in the Doc dir skip news sprint topic-C-API

Projects

Status: Done
Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants