Looking into Queue.py in Python 2.6, I found this construct that I found a bit strange:
def full(self):
\"\"\"Return True if the queue is full, False oth
The strange behavior your experiencing comes from pythons ability to chain conditions. Since it finds 0 is not less than 0, it decides the entire expression evaluates to false. As soon as you break this apart into seperate conditions, you're changing the functionality. It initially is essentially testing that a < b && b == c
for your original statement of a < b == c
.
Another example:
>>> 1 < 5 < 3
False
>>> (1 < 5) < 3
True