The second example came from a desire that: x < y < z “just work”. In language design we don't always appreciate the consequences of our actions.
-
-
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
-
-
lists are not equal to tuples. Python is dynamic, strong typed language.
-
The explanations page mentions that. But there are a lot of cases of cross-type equality: 1 == True, "a" == u"a", 1 == 1.0, etc.
- 1 more reply
New conversation -
-
-
The first arises from loss of precision on conversion to float. The second is operator chaining - the first comparison is True and the second comparison is True. The third (least surprising to me) arises from the fact that tuples aren't equal to lists, even if contents are equal.
- 1 more reply
New conversation -
-
-
Don't all these boil down to the fact that Python is dynamically typed ?
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.