]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
GH-101291: Add warning to "what's new" that `PyLongObject` internals have changed...
authorMark Shannon <mark@hotpy.org>
Fri, 28 Jul 2023 16:07:33 +0000 (17:07 +0100)
committerGitHub <noreply@github.com>
Fri, 28 Jul 2023 16:07:33 +0000 (17:07 +0100)
Doc/whatsnew/3.12.rst

index 68e5b0691f00e4d51f9b2267fd1a8d765c5dacc4..99500e1f3214684311ab261c477f0862ef49887c 100644 (file)
@@ -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
 ----------