mirror of
https://github.com/python/cpython.git
synced 2025-08-04 17:08:35 +00:00
bpo-38558: Mention :=
in conditions tutorial (GH-16919)
This commit is contained in:
parent
7320ec05f7
commit
cb2cf06b0a
1 changed files with 4 additions and 4 deletions
|
@ -675,10 +675,10 @@ to a variable. For example, ::
|
|||
>>> non_null
|
||||
'Trondheim'
|
||||
|
||||
Note that in Python, unlike C, assignment cannot occur inside expressions. C
|
||||
programmers may grumble about this, but it avoids a common class of problems
|
||||
encountered in C programs: typing ``=`` in an expression when ``==`` was
|
||||
intended.
|
||||
Note that in Python, unlike C, assignment inside expressions must be done
|
||||
explicitly with the walrus operator ``:=``. This avoids a common class of
|
||||
problems encountered in C programs: typing ``=`` in an expression when ``==``
|
||||
was intended.
|
||||
|
||||
|
||||
.. _tut-comparing:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue