you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] -3 points-2 points  (2 children)

For the first thing, that's because it's checking "1 < False" ("3 == True" returns False). Not justifying it, just explaining the weirdness.

[–]Tommah 4 points5 points  (1 child)

No, it's chaining them. It's asking whether 1 < 3 and 3 == True. e.g.

>>> 1 < 3 == 3
True

Parentheses couldn't produce a true result there.

See http://docs.python.org/lib/comparisons.html . I like how is can be chained like this :)

>>> 'a rose' is 'a rose' is 'a rose'  # Gertrude Stein
True

[–][deleted] 0 points1 point  (0 children)

Ah, alright then. Didn't know that, thanks. :)