6 ms·
After a little trial and error, it appears that Python caches the values in range(-5,257). > -6 + 0 is -6 False > -5 + 0 is -5 True > 256 + 0 is 256
by nslocum 13y ago
After a little trial and error, it appears that Python caches the values in range(-5,257).
> -6 + 0 is -6
False
> -5 + 0 is -5
True
> 256 + 0 is 256
True
> 257 + 0 is 257
False
- wahnfrieden 13y ago(CPython)