Skip to content

GH-101291: Add warning to "what's new" that PyLongObject internals have changed. #107388

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
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions Doc/whatsnew/3.12.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1865,6 +1865,17 @@ Porting to Python 3.12
subinterpreter that they don't support (or haven't yet been loaded in). See
:gh:`104668` for more info.

* :c:struct:`PyLongObject` has had its internals changed for better performance.
Although the internals of :c:struct:`PyLongObject` are private, they are used
by some extension modules.
The internal fields should no longer be accessed directly, instead the API
functions beginning ``PyLong_...`` should be used instead.
Two new *unstable* API functions are provided for efficient access to the
value of :c:struct:`PyLongObject`\s which fit into a single machine word:

* :c:func:`PyUnstable_Long_IsCompact`
* :c:func:`PyUnstable_Long_CompactValue`

Deprecated
----------

Expand Down