0

Could you explain me simply why (3**2000 is 3**2000) is evaluated as False?

smci
  • 32,567
  • 20
  • 113
  • 146
Teach
  • 1
  • 6
    Why 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
  • 1
    See 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

0 Answers0