Skip to content

GH-109975: Copyedit 3.13 What's New: C API #124313

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Sep 23, 2024

Conversation

AA-Turner
Copy link
Member

@AA-Turner AA-Turner commented Sep 22, 2024

A copy-editing pass for C API. This one is quite large as we move the changes to, deprecated, and removed C API sub-sections from the 'porting' section to the 'C API' section, where they belong.

  • Per @serhiy-storchaka in GH-109975: Copyedit 3.13 What's New: Release Highlights #122958 (comment) I've organised each section by group (function, constant, macro, etc), and then alphabetically within that group.
  • I have highlighted some bigger APIs at the top of 'New features', though.
  • I've added a new sub-section for changes to the limited C API.
  • I haven't looked at c-api-pending-removal-in-XXX.rst as this PR was getting too large already, I'll do that after this PR and assess if anything pressing needs updating.

A


📚 Documentation preview 📚: https://cpython-previews--124313.org.readthedocs.build/en/124313/whatsnew/3.13.html#c-api-changes

Copy link
Member

@serhiy-storchaka serhiy-storchaka left a comment

Choose a reason for hiding this comment

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

Great work!

Some lines look too long, and some lines look unnecessary short. Could you please reformat the text using the recommended maximal line length (I think 79 from PEP 12 is applied here)?

Alphabetical order is perhaps necessary for such large number of changes, but in some cases I think that it would be better to group semantically close changes together. For example, PyObject_GenericHash and Py_HashPointer. Or PyMapping_GetOptionalItem, which is close to PyDict_* changes and to PyObject_GetOptionalAttr, and to PyMapping_HasKeyWithError. But I do not see a way how this can be improved.

* PyDict*: PyMapping_GetOptionalItem and PyObject_GetOptionalAttr
* Py_HashPointer and Py_HashPointer
Copy link
Member Author

@AA-Turner AA-Turner left a comment

Choose a reason for hiding this comment

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

Thanks for the review, I've pushed two commits.

Some lines look too long, and some lines look unnecessary short. Could you please reformat the text using the recommended maximal line length (I think 79 from PEP 12 is applied here)?

The devguide also says 79/80, but in a few places I've gone a couple of characters over to avoid a mostly empty orphan line.

I've rebalanced the particularly egregious case you pointed out, but breaking lines early is a somewhat intentional choice (some people call it semantic line breaks) where I break the line at punctuation or a clause in a sentence. This tends to lead to smaller diffs later down the line, as re-wrapping an entire paragraph for changing a single word can be avoided.

(This is of course only visible in the .rst -- the vast majority readers will never know which lines were broken where in the HTML or PDF output)

A

@AA-Turner AA-Turner merged commit 9d0a752 into python:main Sep 23, 2024
25 checks passed
@AA-Turner AA-Turner deleted the docs/whatsnew/c-api branch September 23, 2024 13:28
@miss-islington-app
Copy link

Thanks @AA-Turner for the PR 🌮🎉.. I'm working now to backport this PR to: 3.13.
🐍🍒⛏🤖

@miss-islington-app
Copy link

Sorry, @AA-Turner, I could not cleanly backport this to 3.13 due to a conflict.
Please backport using cherry_picker on command line.

cherry_picker 9d0a75269c6ae361b1ed5910c3b3424ed93b6f6d 3.13

AA-Turner added a commit to AA-Turner/cpython that referenced this pull request Sep 23, 2024
)

(cherry picked from commit 9d0a752)

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
@bedevere-app
Copy link

bedevere-app bot commented Sep 23, 2024

GH-124334 is a backport of this pull request to the 3.13 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.13 bugs and security fixes label Sep 23, 2024
Yhg1s pushed a commit that referenced this pull request Sep 23, 2024
* [3.13] GH-109975: Copyedit 3.13 What's New: C API (GH-124313)
(cherry picked from commit 9d0a752)

* gh-118915: Add/fix docs entries for some new 3.13 C API (GH-124134)

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants