Skip to content

Commit 1378bde

Browse files
committed
Make the doctest actually run & fix it.
1 parent fcb123b commit 1378bde

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

Doc/library/stdtypes.rst

+3-1
Original file line numberDiff line numberDiff line change
@@ -5277,6 +5277,8 @@ and the sign are not counted towards the limit.
52775277

52785278
When an operation would exceed the limit, a :exc:`ValueError` is raised::
52795279

5280+
.. doctest::
5281+
52805282
>>> import sys
52815283
>>> sys.set_int_max_str_digits(4300) # Illustrative, this is the default.
52825284
>>> _ = int('2' * 5432)
@@ -5293,7 +5295,7 @@ When an operation would exceed the limit, a :exc:`ValueError` is raised::
52935295
ValueError: Exceeds the limit (4300) for integer string conversion: value has 8599 digits.
52945296
>>> len(hex(i_squared))
52955297
7144
5296-
>>> assert int(hex(i_squared), base=16) == i # Hexidecimal is unlimited.
5298+
>>> assert int(hex(i_squared), base=16) == i*i # Hexidecimal is unlimited.
52975299

52985300
The default limit is 4300 digits as provided in
52995301
:data:`sys.int_info.default_max_str_digits <sys.int_info>`.

Misc/NEWS.d/next/Security/2022-08-07-16-53.gh-issue-95778.ch010gps.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,5 @@ line flag, or :mod:`sys` APIs. See the :ref:`integer string conversion length
1010
limitation <int_max_str_digits>` documentation. The default limit is 4300
1111
digits in string form.
1212

13-
Patch by Gregory P. Smith [Google] and Christian Heimes [Red Hat] with feedback from
14-
Victor Stinner, Thomas Wouters, and Steve Dower.
13+
Patch by Gregory P. Smith [Google] and Christian Heimes [Red Hat] with feedback
14+
from Victor Stinner, Thomas Wouters, Steve Dower, and Ned Deily.

0 commit comments

Comments
 (0)