Skip to content

Commit cf028b5

Browse files
bpo-38558: Mention := in conditions tutorial (GH-16919)
(cherry picked from commit cb2cf06) Co-authored-by: Ammar Askar <[email protected]>
1 parent edf9e8e commit cf028b5

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Doc/tutorial/datastructures.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -675,10 +675,10 @@ to a variable. For example, ::
675675
>>> non_null
676676
'Trondheim'
677677

678-
Note that in Python, unlike C, assignment cannot occur inside expressions. C
679-
programmers may grumble about this, but it avoids a common class of problems
680-
encountered in C programs: typing ``=`` in an expression when ``==`` was
681-
intended.
678+
Note that in Python, unlike C, assignment inside expressions must be done
679+
explicitly with the walrus operator ``:=``. This avoids a common class of
680+
problems encountered in C programs: typing ``=`` in an expression when ``==``
681+
was intended.
682682

683683

684684
.. _tut-comparing:

0 commit comments

Comments
 (0)