Quantcast
Channel: Active questions tagged python - Stack Overflow
Viewing all articles
Browse latest Browse all 23131

ValueError: Exceeds the limit (4300) for integer string conversion

$
0
0
>>> import sys>>> sys.set_int_max_str_digits(4300)  # Illustrative, this is the default.>>> _ = int('2' * 5432)Traceback (most recent call last):...ValueError: Exceeds the limit (4300) for integer string conversion: value has 5432 digits.

Python 3.10.7 introduced this breaking change for type conversion.

Documentation: Integer string conversion length limitation

Actually I don't understand why

  1. this was introduced and
  2. where does the default value of 4300 come from? Sounds like an arbitrary number.

Viewing all articles
Browse latest Browse all 23131

Trending Articles