Skip to content

Docs give incorrect grouping for conditional expressions #96417

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
kaya3 opened this issue Aug 30, 2022 · 1 comment · Fixed by #96447
Closed

Docs give incorrect grouping for conditional expressions #96417

kaya3 opened this issue Aug 30, 2022 · 1 comment · Fixed by #96447
Labels
3.10 only security fixes 3.11 only security fixes 3.12 only security fixes docs Documentation in the Doc dir

Comments

@kaya3
Copy link
Contributor

kaya3 commented Aug 30, 2022

Documentation

Quoting from 6.17 Operator Precedence:

Operators in the same box group left to right (except for exponentiation, which groups from right to left).

Another exception should be included for conditional expressions, which also group from right to left: a if b else c if d else e is equivalent to a if b else (c if d else e), not (a if b else c) if d else e.

@kaya3 kaya3 added the docs Documentation in the Doc dir label Aug 30, 2022
@rhettinger rhettinger added 3.11 only security fixes 3.10 only security fixes 3.12 only security fixes labels Aug 30, 2022
@rhettinger
Copy link
Contributor

Agreed.

Do care to make a PR?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3.10 only security fixes 3.11 only security fixes 3.12 only security fixes docs Documentation in the Doc dir
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants