>>> 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
- this was introduced and
- where does the default value of 4300 come from? Sounds like an arbitrary number.