What is sys.maxint in Python 3?

Ci3 picture Ci3 · Dec 10, 2012 · Viewed 234k times · Source

I've been trying to find out how to represent a maximum integer, and I've read to use "sys.maxint". However, in Python 3 when I call it I get:

AttributeError: module 'object' has no attribute 'maxint'

Answer

Diego Basch picture Diego Basch · Dec 10, 2012

The sys.maxint constant was removed, since there is no longer a limit to the value of integers. However, sys.maxsize can be used as an integer larger than any practical list or string index. It conforms to the implementation’s “natural” integer size and is typically the same as sys.maxint in previous releases on the same platform (assuming the same build options).

http://docs.python.org/3.1/whatsnew/3.0.html#integers