Add ..versionadded for sys.int_info, update py3k version of · pythoncapi/cpython@d72c7b6 · GitHub
Skip to content

Commit d72c7b6

Browse files
committed
Add ..versionadded for sys.int_info, update py3k version of
whatsnew/2.7.rst to keep it in sync with the trunk version, and replace SHIFT with PyLong_SHIFT in #error message
1 parent 0ef2cf6 commit d72c7b6

3 files changed

Lines changed: 27 additions & 1 deletion

File tree

Doc/library/sys.rst

Lines changed: 2 additions & 0 deletions

Doc/whatsnew/2.7.rst

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,30 @@ Some smaller changes made to the core Python language are:
8686
(Contributed by Fredrik Johansson and Victor Stinner; :issue:`3439`.)
8787

8888

89+
* Integers are now stored internally either in base 2**15 or in base
90+
2**30, the base being determined at build time. Previously, they
91+
were always stored in base 2**15. Using base 2**30 gives
92+
significant performance improvements on 64-bit machines, but
93+
benchmark results on 32-bit machines have been mixed. Therefore,
94+
the default is to use base 2**30 on 64-bit machines and base 2**15
95+
on 32-bit machines; on Unix, there's a new configure option
96+
--enable-big-digits that can be used to override this default.
97+
98+
Apart from the performance improvements this change should be
99+
invisible to end users, with one exception: for testing and
100+
debugging purposes there's a new structseq ``sys.long_info`` that
101+
provides information about the internal format, giving the number of
102+
bits per digit and the size in bytes of the C type used to store
103+
each digit::
104+
105+
>>> import sys
106+
>>> sys.long_info
107+
sys.long_info(bits_per_digit=30, sizeof_digit=4)
108+
109+
110+
(Contributed by Mark Dickinson; :issue:`4258`.)
111+
112+
89113
.. ======================================================================
90114
91115

Include/longintrepr.h

Lines changed: 1 addition & 1 deletion

0 commit comments

Comments
 (0)