About PyLong_FromLong Implementation

From PyLong_FromLong documentation(3.12.5):

The current implementation keeps an array of integer objects for all integers between -5 and 256. When you create an int in that range you actually just get back a reference to the existing object.

I’m not sure here, but Is there anything special about this range?

Thank you

Numbers in that range commonly used, so it saves memory.

1 Like