]> granicus.if.org Git - python/commitdiff
Add ..versionadded for sys.int_info, update py3k version of
authorMark Dickinson <dickinsm@gmail.com>
Fri, 20 Mar 2009 16:00:49 +0000 (16:00 +0000)
committerMark Dickinson <dickinsm@gmail.com>
Fri, 20 Mar 2009 16:00:49 +0000 (16:00 +0000)
whatsnew/2.7.rst to keep it in sync with the trunk version, and
replace SHIFT with PyLong_SHIFT in #error message

Doc/library/sys.rst
Doc/whatsnew/2.7.rst
Include/longintrepr.h

index 091b4d65b5157a1330eabe1618099e2231b76995..632e55007a1ebee19f9a53502309ddd503cbfa82 100644 (file)
@@ -429,6 +429,8 @@ always available.
    |                         | represent a digit                            |
    +-------------------------+----------------------------------------------+
 
+   .. versionadded:: 3.1
+
 
 .. function:: intern(string)
 
index 8037b1319cb7f033594bad64989452b30b78d400..e44a42b3539f4ca0b5ccd0010b8179d2de36f95b 100644 (file)
@@ -86,6 +86,30 @@ Some smaller changes made to the core Python language are:
   (Contributed by Fredrik Johansson and Victor Stinner; :issue:`3439`.)
 
 
+* Integers are now stored internally either in base 2**15 or in base
+  2**30, the base being determined at build time.  Previously, they
+  were always stored in base 2**15.  Using base 2**30 gives
+  significant performance improvements on 64-bit machines, but
+  benchmark results on 32-bit machines have been mixed.  Therefore,
+  the default is to use base 2**30 on 64-bit machines and base 2**15
+  on 32-bit machines; on Unix, there's a new configure option
+  --enable-big-digits that can be used to override this default.
+
+  Apart from the performance improvements this change should be
+  invisible to end users, with one exception: for testing and
+  debugging purposes there's a new structseq ``sys.long_info`` that
+  provides information about the internal format, giving the number of
+  bits per digit and the size in bytes of the C type used to store
+  each digit::
+
+     >>> import sys
+     >>> sys.long_info
+     sys.long_info(bits_per_digit=30, sizeof_digit=4)
+
+
+  (Contributed by Mark Dickinson; :issue:`4258`.)
+
+
 .. ======================================================================
 
 
index 144d04b8dd82ab003ccaa5cf225717e6006c47fa..dd0933a9ca623c544a47284253c0280447485957 100644 (file)
@@ -67,7 +67,7 @@ typedef long stwodigits; /* signed variant of twodigits */
 #define PyLong_MASK    ((digit)(PyLong_BASE - 1))
 
 #if PyLong_SHIFT % 5 != 0
-#error "longobject.c requires that SHIFT be divisible by 5"
+#error "longobject.c requires that PyLong_SHIFT be divisible by 5"
 #endif
 
 /* Long integer representation.