Small Integer Caching
What is small integer caching? Python caches small integers, which are integers between
256. These numbers are used so frequently that it’s better for performance to already have these objects available. So these integers will be assigned at startup. Then, each time you refer to one, you’ll be referring to an object that already exists.
Become a Member to join the conversation.