In Python, what is `sys.maxsize`?

Python can handle arbitrarily large integers in computation. Any integer too big to fit in 64 bits (or whatever the underlying hardware limit is) is handled in software. For that reason, Python 3 doesn’t have a sys.maxint constant.

The value sys.maxsize, on the other hand, reports the platform’s pointer size, and that limits the size of Python’s data structures such as strings and lists.

Leave a Comment