Does this do what I think it does?
assert 1 < 2 < 3
I couldn't find any reference to this in the docs but I saw it in a high rep answer.
It seems to work but it could be luck, like the leftmost resolves to True
, then True
is used in the other.
I did a few tests and it always work as expected, but I'd like to find a source (a doc) stating explicitly that it is intended.
>>> 1<2<3<4<5
True
>>> 1<2<7<4<5
False
>>> 1<2<3>2<5
True
This rules out the "leftmost first" hypothesis:
>>> 1<3<2
False
>>> (1<3)<2
True