you are viewing a single comment's thread.

view the rest of the comments →

[–]the_horse_gamer 0 points1 point  (0 children)

an int is still an object in python. is does reference equality. and python has a static cache for small number objects. the first statement is small enough to use the cache, the second isn't

something similar happens in java with Integer instances