Maximum negative integer string representations are not accepted by int(). Why?

Lexy Zhitenev zhitenev at cs.vsu.ru
Sat Feb 22 05:13:41 EST 2003


Python 2.2 has introduced a feature of converting integers to long integers
they exceed this limit (-2147483648..2147483647). That's what exactly
happens, when you try to convert a normal number.

But when you try to convert a string that represents a number, it cannot be
automatically converted to long.
Just try to use 'long' type converter instead of 'int' with any number
base - and your problem will vanish.

Lexy






More information about the Python-list mailing list