Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions Doc/reference/expressions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1774,10 +1774,11 @@ Or, when processing a file stream in chunks:
while chunk := file.read(9000):
process(chunk)

Assignment expressions must be surrounded by parentheses when used
as sub-expressions in slicing, conditional, lambda,
keyword-argument, and comprehension-if expressions
and in ``assert`` and ``with`` statements.
Assignment expressions must be surrounded by parentheses when
used as expression statements and when used as sub-expressions in
slicing, conditional, lambda,
keyword-argument, and comprehension-if expressions and
in ``assert``, ``with``, and ``assignment`` statements.
In all other places where they can be used, parentheses are not required,
including in ``if`` and ``while`` statements.

Expand Down