summaryrefslogtreecommitdiffstats
path: root/Doc/library
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2022-12-12 11:39:54 (GMT)
committerGitHub <noreply@github.com>2022-12-12 11:39:54 (GMT)
commit935ef593211a627526b2b869ce1fc2a5e67e6cdd (patch)
tree62875b252f6d9843c6cedcd9c1ee50f340c8b8c6 /Doc/library
parent70be5e42f6e288de32e0df3c77ac22a9ddf1a74b (diff)
downloadcpython-935ef593211a627526b2b869ce1fc2a5e67e6cdd.zip
cpython-935ef593211a627526b2b869ce1fc2a5e67e6cdd.tar.gz
cpython-935ef593211a627526b2b869ce1fc2a5e67e6cdd.tar.bz2
clarify the 4300-digit limit on int-str conversion (#100175)
Diffstat (limited to 'Doc/library')
-rw-r--r--Doc/library/stdtypes.rst4
1 files changed, 2 insertions, 2 deletions
diff --git a/Doc/library/stdtypes.rst b/Doc/library/stdtypes.rst
index 40f787f..c785336 100644
--- a/Doc/library/stdtypes.rst
+++ b/Doc/library/stdtypes.rst
@@ -5503,7 +5503,7 @@ When an operation would exceed the limit, a :exc:`ValueError` is raised:
>>> _ = int('2' * 5432)
Traceback (most recent call last):
...
- ValueError: Exceeds the limit (4300) for integer string conversion: value has 5432 digits; use sys.set_int_max_str_digits() to increase the limit.
+ ValueError: Exceeds the limit (4300 digits) for integer string conversion: value has 5432 digits; use sys.set_int_max_str_digits() to increase the limit.
>>> i = int('2' * 4300)
>>> len(str(i))
4300
@@ -5511,7 +5511,7 @@ When an operation would exceed the limit, a :exc:`ValueError` is raised:
>>> len(str(i_squared))
Traceback (most recent call last):
...
- ValueError: Exceeds the limit (4300) for integer string conversion: value has 8599 digits; use sys.set_int_max_str_digits() to increase the limit.
+ ValueError: Exceeds the limit (4300 digits) for integer string conversion: value has 8599 digits; use sys.set_int_max_str_digits() to increase the limit.
>>> len(hex(i_squared))
7144
>>> assert int(hex(i_squared), base=16) == i*i # Hexadecimal is unlimited.