Documentation
Initially reported in docs mailing list by Denilson Sá Maia
https://mail.python.org/archives/list/docs@python.org/thread/NZTUNIYEZVY2WOF3GH6TAZ32OLMKR3QO/
https://docs.python.org/3.10/reference/expressions.html
At section 6.13, it says: “Conditional expressions (sometimes called a
“ternary operator”) have the lowest priority of all Python
operations.”
However, further down below in the "6.17. Operator precedence"
section, the if-else expression has higher precedence than both lambda
and walrus. Maybe those two are not technically "operations", but
since they are under operator precedence, they are operations.
It's confusing, and it's a minor detail, but still worth fixing.
Linked PRs
Documentation
Initially reported in docs mailing list by Denilson Sá Maia
https://mail.python.org/archives/list/docs@python.org/thread/NZTUNIYEZVY2WOF3GH6TAZ32OLMKR3QO/
https://docs.python.org/3.10/reference/expressions.html
At section 6.13, it says: “Conditional expressions (sometimes called a
“ternary operator”) have the lowest priority of all Python
operations.”
However, further down below in the "6.17. Operator precedence"
section, the if-else expression has higher precedence than both lambda
and walrus. Maybe those two are not technically "operations", but
since they are under operator precedence, they are operations.
It's confusing, and it's a minor detail, but still worth fixing.
Linked PRs