This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Operator precedence for 1<-1==0
Type: Stage: resolved
Components: Interpreter Core Versions: Python 3.4
process
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: Nosy List: r.david.murray, tomskaczmarek
Priority: normal Keywords:

Created on 2015-07-07 18:37 by tomskaczmarek, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Messages (2)
msg246439 - (view) Author: (tomskaczmarek) Date: 2015-07-07 18:37
As I understand operator precedence the expression 1<-1==0 ought to evaluate in the following order: 1<-1 evaluates to False (or 0) then False == 0 ought to evaluate yielding True. However, this evaluates to False in my Python 3.4.3 Shell. (1<-1)==0 evaluates to True
msg246440 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2015-07-07 18:42
You missed the sentence just before the table that mentions that comparisons support chaining (see https://docs.python.org/3/reference/expressions.html#not-in).  1<-1==0 is actually equivalent to (1<-1) and (1==0), which is False.
History
Date User Action Args
2022-04-11 14:58:18adminsetgithub: 68774
2015-07-07 18:42:40r.david.murraysetstatus: open -> closed

nosy: + r.david.murray
messages: + msg246440

resolution: not a bug
stage: resolved
2015-07-07 18:37:25tomskaczmarekcreate