The upper limit of Python integers is determined by by the size of addressable memory. On 64-bit platforms this is about $2^{63}$ bytes or about $15\cdot 2^{62} < 2^{66}$ bits. Unfortunately, the number of bits of some integers cannot be represented as a 64-bit integer, this complicates the code.
The following PR lowers the limit to about $2^{64}$ bits or about $2^{65}/15 > 2^{61}$ bytes. It is still much larger than practically achievable (larger that the limit of addressable memory in modern processors).
First proposed in #121486, then discussed in https://discuss.python.org/t/imposing-a-hard-limit-on-python-integers/62302.
Linked PRs
The upper limit of Python integers is determined by by the size of addressable memory. On 64-bit platforms this is about$2^{63}$ bytes or about $15\cdot 2^{62} < 2^{66}$ bits. Unfortunately, the number of bits of some integers cannot be represented as a 64-bit integer, this complicates the code.
The following PR lowers the limit to about$2^{64}$ bits or about $2^{65}/15 > 2^{61}$ bytes. It is still much larger than practically achievable (larger that the limit of addressable memory in modern processors).
First proposed in #121486, then discussed in https://discuss.python.org/t/imposing-a-hard-limit-on-python-integers/62302.
Linked PRs