Understanding memory allocation for large integers in Python
问题 How does Python allocate memory for large integers? An int type has a size of 28 bytes and as I keep increasing the value of the int , the size increases in increments of 4 bytes . Why 28 bytes initially for any value as low as 1 ? Why increments of 4 bytes ? PS: I am running Python 3.5.2 on a x86_64 (64 bit machine). Any pointers/resources/PEPs on how the (3.0+) interpreters work on such huge numbers is what I am looking for. Code illustrating the sizes: >>> a=1 >>> print(a.__sizeof__()) 28