Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 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
5 changes: 5 additions & 0 deletions Doc/reference/expressions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1687,6 +1687,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 subscript, slicing, conditional, lambda,
keyword-argument, generator, and comprehension-if expressions. They
can only be used as is in if and while statements and in decorators.

.. versionadded:: 3.8
See :pep:`572` for more details about assignment expressions.

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Document some places where an assignment expression needs parentheses.