Python Integer Caching: Why 256 is 256 but 257 is Not
Why does 256 is 256 evaluate to True, but 257 is 257 return False? Python pre-allocates small integer objects (traditionally -5 to 256) inside a global array to save memory. Because this optimization
Oct 2, 20264 min read
