>>> True = 2
Here you assign 2 to True . So, now True in the module area is actually 2 :
>>> print(True) 2
1 == 1 True . True is 1 .
>>> 1 - (1 == 1) 0
You may ask why this is not 2 , as indicated above. Well, the True variable is equal to region 2 in the scope of the module, and (1==1) returns a link (tag) to real True . So, 1==1 is real True , equal to 1 , so 1 - (1 == 1) is 0 .
>>> print True == (1 == 1) False
Here 1 == 1 again return the link to the real True . But True in the first part of the expression refers to the scope of the module, so in fact it is 2 . So this expression is effectively 2 == (True) , which is False .
source share