Could you explain me simply why (3**2000 is 3**2000)
is evaluated as False
?
Asked
Active
Viewed 27 times
0
-
6Why do you think it should be `True`? Are the two results the *same object*? Or are they two different objects with the *same value*? – Martijn Pieters Jul 27 '15 at 14:31
-
@Martijn Pieters: Thank you for your quick answer but how to explain that (3**2 is 3**2) is evaluated as True? – Teach Jul 27 '15 at 14:36
-
1See the linked duplicate. `3 ** 2` is `9`, which is an interned number. That small numbers are interned (cached) is an optimisation. – Martijn Pieters Jul 27 '15 at 14:38