This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: sys.getsizeof(0) is incorrect
Type: behavior Stage: needs patch
Components: Interpreter Core Versions: Python 3.6, Python 3.5
process
Status: closed Resolution: wont fix
Dependencies: Superseder:
Assigned To: mark.dickinson Nosy List: mark.dickinson
Priority: low Keywords:

Created on 2016-09-12 07:59 by mark.dickinson, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Messages (3)
msg275987 - (view) Author: Mark Dickinson (mark.dickinson) * (Python committer) Date: 2016-09-12 07:59
Low-priority issue, possibly not worth fixing at all, but maybe worth recording.

sys.getsizeof(0) currently reports 24 on a 64-bit machine using 30-bit limbs. That's inaccurate, since we're actually allocating 28 bytes for 0 as part of the small-int cache. PyLong_FromLong also always requests at least one limb.
msg275989 - (view) Author: Mark Dickinson (mark.dickinson) * (Python committer) Date: 2016-09-12 08:01
Related: http://bugs.python.org/issue3690
msg275994 - (view) Author: Mark Dickinson (mark.dickinson) * (Python committer) Date: 2016-09-12 08:25
I don't think anything has changed substantially since the discussion in issue 3690. Closing as "won't fix".
History
Date User Action Args
2022-04-11 14:58:36adminsetgithub: 72285
2016-09-12 08:25:20mark.dickinsonsetstatus: open -> closed
resolution: wont fix
messages: + msg275994
2016-09-12 08:01:24mark.dickinsonsetmessages: + msg275989
2016-09-12 07:59:33mark.dickinsoncreate