]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-100637: Fix int and bool __sizeof__ calculation to include the 1 element ob_digit...
authorIonite <dev@ionite.io>
Mon, 2 Jan 2023 21:11:49 +0000 (05:11 +0800)
committerGitHub <noreply@github.com>
Mon, 2 Jan 2023 21:11:49 +0000 (21:11 +0000)
commitd7e7f79ca7c2029e46a06d21a7a5abea631b5d13
tree5ac123fa1dcaeebf3707476785fa1e9cf9317587
parent9dee9731663d670652586c929190f227ab56bd8f
gh-100637: Fix int and bool __sizeof__ calculation to include the 1 element ob_digit array for 0 and False (#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.

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