Python's Object Tax: Why Integers Bloat

Every Python integer is an object with inherent overhead, including a reference count, type pointer, and size information, typically consuming around 28 bytes for small integers, which enables Python's dynamic typing and arbitrary precision.

Sources

Open the full topic