]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.12] GH-101291: Add warning to "what's new" that `PyLongObject` internals have...
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Mon, 31 Jul 2023 17:16:00 +0000 (10:16 -0700)
committerGitHub <noreply@github.com>
Mon, 31 Jul 2023 17:16:00 +0000 (10:16 -0700)
(cherry picked from commit 1ee605c5888fbc3d51b3e7610bac38ea6bc25e31)

Co-authored-by: Mark Shannon <mark@hotpy.org>
Doc/whatsnew/3.12.rst

index 2ec25eb25ecb47780bfdd16072e744921b01b2b5..fe912e8422e9ee61c9c8721bc3db2320ff4a61bc 100644 (file)
@@ -1867,6 +1867,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
 ----------