Skip to content

gh-65058: Document the grouping of conditional expressions - #162167

Open
lul-cas wants to merge 5 commits into
python:mainfrom
lul-cas:fix-issue-65058
Open

lul-cas wants to merge 5 commits into
python:mainfrom
lul-cas:fix-issue-65058

Conversation

@lul-cas

@lul-cas lul-cas commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

This continues #119171 by @mas192, who agreed to let me take it over, and supersedes the original PR

Two of the three points raised in the issue have already been addressed on main:

This PR addresses the remaining grouping point:

Conditional expressions: Clarifies that they group from right to left, using an example based on the one from #119171.

The evaluation order change was dropped after review.

Co-authored-by: Sam Joshva samjoshva@gmail.com :)

lul-cas and others added 2 commits November 17, 2026 15:31
…eft to right

The "Evaluation order" section said that expressions are always
evaluated from left to right, but a conditional expression evaluates
its condition first.
Add a sentence and an example showing that chained conditional
expressions group from right to left.

Co-authored-by: Sam Joshva <samjoshva@gmail.com>
@read-the-docs-community

read-the-docs-community Bot commented Nov 17, 2026 •

Copy link
Copy Markdown

Comment thread Doc/reference/expressions.rst Resolved
Comment thread Doc/reference/expressions.rst Resolved
Comment thread Doc/reference/expressions.rst Resolved
@lul-cas lul-cas changed the title gh-65058: Document evaluation order and grouping of conditional expressions gh-65058: Document the grouping of conditional expressions Nov 18, 2026
lul-cas and others added 2 commits November 17, 2026 22:07
…luated left to right"

This reverts commit ba6ac10.

Co-authored-by: Bartosz Sławecki <bartosz@ilikepython.com>
Co-authored-by: Bartosz Sławecki <bartosz@ilikepython.com>
@lul-cas
lul-cas requested a review from johnslavik November 18, 2026 01:14
Comment thread Doc/reference/expressions.rst Resolved
@lul-cas
lul-cas requested a review from encukou November 24, 2026 00:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting core review docs Documentation in the Doc dir skip news

Projects

Status: Todo

Development

Successfully merging this pull request may close these issues.

3 participants