Show HN: An inconsistent logic in python 2.7

1 points by obblekk ↗ HN

  Python 2.7.6 (default, Nov 21 2013, 15:55:38) [GCC] on linux2
  Type "help", "copyright", "credits" or "license" for more information.
  >>> True = False
  >>> 3 == 3 == True
  False

1 comment

[ 1.3 ms ] story [ 14.7 ms ] thread
It's not inconsistent. The variable "True" now has the value False. 3 == 3 yields the value True, which is not equal to the value in the variable "True" which is False. You should try:

  >>> True = False
  >>> 3 == 3 == bool("True")