]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
[3.11] gh-100637: Fix int and bool __sizeof__ calculation to include the 1 element...
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Tue, 3 Jan 2023 17:59:40 +0000 (09:59 -0800)
committerGitHub <noreply@github.com>
Tue, 3 Jan 2023 17:59:40 +0000 (17:59 +0000)
commit50409a29685ca600d1893920515a094954e83f56
treeb5f5e08b0cac42d0b55bd5118f7ebca2965c30a9
parent861cdefc1bccd419bd268a9f60b34bffbaff9ea2
[3.11] gh-100637: Fix int and bool __sizeof__ calculation to include the 1 element ob_digit array for 0 and False (GH-100663) (#100717)

gh-100637: Fix int and bool __sizeof__ calculation to include the 1 element ob_digit array for 0 and False (GH-100663)

Fixes behaviour where int (and subtypes like bool) __sizeof__ under-reports true size as it did not take into account the size 1 `ob_digit` array for the zero int.

(cherry picked from commit d7e7f79ca7c2029e46a06d21a7a5abea631b5d13)

Co-authored-by: Ionite <dev@ionite.io>
Co-authored-by: Mark Dickinson <dickinsm@gmail.com>
Lib/test/test_sys.py
Misc/NEWS.d/next/Core and Builtins/2023-01-01-15-59-48.gh-issue-100637.M2n6Kg.rst [new file with mode: 0644]
Objects/longobject.c