In the latest Python 2 documentation:
sys.maxsize
The largest positive integer supported by the platform’s Py_ssize_t type, and thus the maximum size lists, strings, dicts, and many other containers can have.
In the latest Python 3 documentation:
sys.maxsize
An integer giving the maximum value a variable of type Py_ssize_t can take. It’s usually 2**31 - 1 on a 32-bit platform and 2**63 - 1 on a 64-bit platform.
The value sys.maxsize
is in this file used on Python 2 with the values specified in the Python 3 documentation:
- 2**31 - 1 = 2147483647;
- 2**63 - 1 = 9223372036854775807.
My question is: what are the possible values sys.maxsize
can take in Python 2? Are these two part of the possible values or not? Are there any other possible values (on other platforms or operating systems, for example)? It would be interesting to find the possible values that it can take in Python 3 too.
Related questions: