Код: Выделить всё
>>> 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.
Документация: ограничение длины преобразования целочисленной строки< /p>
Вообще-то я не понимаю, почему
- это было введено и
- откуда взялось значение по умолчанию 4300? Звучит как произвольное число.
Подробнее здесь: https://stackoverflow.com/questions/736 ... conversion