Commit cb2cf06b authored by Ammar Askar's avatar Ammar Askar Committed by Zachary Ware

bpo-38558: Mention `:=` in conditions tutorial (GH-16919)

parent 7320ec05
...@@ -675,10 +675,10 @@ to a variable. For example, :: ...@@ -675,10 +675,10 @@ to a variable. For example, ::
>>> non_null >>> non_null
'Trondheim' 'Trondheim'
Note that in Python, unlike C, assignment cannot occur inside expressions. C Note that in Python, unlike C, assignment inside expressions must be done
programmers may grumble about this, but it avoids a common class of problems explicitly with the walrus operator ``:=``. This avoids a common class of
encountered in C programs: typing ``=`` in an expression when ``==`` was problems encountered in C programs: typing ``=`` in an expression when ``==``
intended. was intended.
.. _tut-comparing: .. _tut-comparing:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment