Why do these statements evaluate the way they do?

Anthony Papillion anthony at cajuntechie.org
Sat May 7 02:36:48 EDT 2016


I'm trying to figure out why the following statements evaluate the way they do and I'm not grasping it for some reason. I'm hoping someone can help me.

40+2 is 42 #evaluates to True
But
2**32 is 2**32 #evaluates to False

This is an example taken from a Microsoft blog on the topic. They say the reason is because the return is based on identity and not value but, to me, these statements are fairly equal.

Can someone clue me in?

Anthony
-- 
Sent from my Android device with K-9 Mail. Please excuse my brevity.




More information about the Python-list mailing list