Issue 28098: sys.getsizeof(0) is incorrect (original) (raw)

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.