3 ms·
Java does the same thing for small numbers.
by jraph 7y ago
Java does the same thing for small numbers.
- matheusmoreira 7y agoYeah, the Integer class maintains a cache of all signed 8 bit values: https://stackoverflow.com/a/3131208/512904 https://stackoverflow.com/a/3131208/512904 In Java, there's a clear distinction between a primitive int value and an Integer object. Not all languages have this property. I thought Python didn't.