8000 [3.12] GH-101291: Add warning to "what's new" that `PyLongObject` int… · python/cpython@5f7862d · GitHub
[go: up one dir, main page]

Skip to content

Commit 5f7862d

Browse files
[3.12] GH-101291: Add warning to "what's new" that PyLongObject internals have changed. (GH-107388) (#107392)
(cherry picked from commit 1ee605c) Co-authored-by: Mark Shannon <mark@hotpy.org>
1 parent f66b992 commit 5f7862d

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

Doc/whatsnew/3.12.rst

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1867,6 +1867,17 @@ Porting to Python 3.12
18671867
subinterpreter that they don't support (or haven't yet been loaded in). See
18681868
:gh:`104668` for more info.
18691869

1870+
* :c:struct:`PyLongObject` has had its internals changed for better performance.
1871+
Although the internals of :c:struct:`PyLongObject` are private, they are used
1872+
by some extension modules.
1873+
The internal fields should no longer be accessed directly, instead the API
1874+
functions beginning ``PyLong_...`` should be used instead.
1875+
Two new *unstable* API functions are provided for efficient access to the
1876+
value of :c:struct:`PyLongObject`\s which fit into a single machine word:
1877+
1878+
* :c:func:`PyUnstable_Long_IsCompact`
1879+
* :c:func:`PyUnstable_Long_CompactValue`
1880+
18701881
Deprecated
18711882
----------
18721883

0 commit comments

Comments
 (0)
0