So I was looking at some code online and I came across a line (at line 286):if depth > 0 and best <= -MATE_VALUE is None and nullscore > -MATE_VALUE:
The part I had trouble understanding was the best <= -MATE_VALUE is None.
So I fired up the interpreter to see how a statement such as value1 > value2 is value3 work.
So I tried
>>> 5 > 2 is True
False
>>> (5 > 2) is True
True
>>> 5 > (2 is True)
True
My Question
Why is 5 > 2 is True not True? And how do these things generally work?
Thanks.
(5 > 2) && (2 is True), which is why/how Python allows a meaningfula < x < bconstruct. There are duplicates about this. - user2864740-MATE_VALUE), then it will never be None (if it were, the-wouldn't work.) So if the line doesn't throw an exception, won't it always return False? - DSMbest <= -MATE_VALUE and -MATE_VALUE is None) nor either of the plausible incorrect interpretations ((best <= -MATE_VALUE) is Noneorbest <= (-MATE_VALUE is None)) makes any sense. - chepner