]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-123497: New limit for Python integers on 64-bit platforms (GH-123724)
authorSerhiy Storchaka <storchaka@gmail.com>
Sun, 29 Sep 2024 07:40:20 +0000 (10:40 +0300)
committerGitHub <noreply@github.com>
Sun, 29 Sep 2024 07:40:20 +0000 (10:40 +0300)
commitd08c7888229e78533648191dfe42e2d2d3ecea25
tree4b638a62a9e80d43573856ed8f081a65ae45ab8a
parente0a41a5dd12cb6e9277b05abebac5c70be684dd7
gh-123497: New limit for Python integers on 64-bit platforms (GH-123724)

Instead of be limited just by the size of addressable memory (2**63
bytes), Python integers are now also limited by the number of bits, so
the number of bit now always fit in a 64-bit integer.

Both limits are much larger than what might be available in practice,
so it doesn't affect users.

_PyLong_NumBits() and _PyLong_Frexp() are now always successful.
Include/cpython/longobject.h
Include/internal/pycore_long.h
Modules/_pickle.c
Modules/_randommodule.c
Modules/mathmodule.c
Objects/floatobject.c
Objects/longobject.c
Python/ast_opt.c