Converting very long strings to integers in Python
SMRTR summary
Python sets limits on string-to-integer conversion at 4300 digits, as revealed when attempting to convert a 5382-digit prime number. Though Python integers have no size limit beyond available memory, direct string conversion fails with a SyntaxError. The problem was solved by breaking the number into smaller strings and performing manual radix conversion.
SMRTR provides this summary for quick context. The original article belongs to John D. Cook.
Read the original article