Steven D'Aprano <steve+pyt...@pearwood.info> added the comment:

Correct output.

https://docs.python.org/3/reference/expressions.html#operator-precedence

a = 10
b = 10
(a >= 10) and not (b == 10) | 7+2 == 9

returns False because of operator precedence. It evaluates like this:

(a >= 10) and not (b == 10) | 7+2 == 9
--> True and not True | 7+2 == 9
--> True and not True | 9 == 9
--> True and not 9 == 9
--> True and not True
--> True and False
--> False

----------
nosy: +steven.daprano
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue42460>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to