[Python-checkins] bpo-38558: Mention `:=` in conditions tutorial (GH-16919)

Miss Skeleton (bot) webhook-mailer at python.org
Fri Oct 25 18:27:11 EDT 2019


https://github.com/python/cpython/commit/cf028b57169499f82b73dd0977fe0bab40778a60
commit: cf028b57169499f82b73dd0977fe0bab40778a60
branch: 3.8
author: Miss Skeleton (bot) <31488909+miss-islington at users.noreply.github.com>
committer: GitHub <noreply at github.com>
date: 2019-10-25T15:27:07-07:00
summary:

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

(cherry picked from commit cb2cf06b0aad1851f54999497c1b50c381d1fdd8)

Co-authored-by: Ammar Askar <ammar at ammaraskar.com>

files:
M Doc/tutorial/datastructures.rst

diff --git a/Doc/tutorial/datastructures.rst b/Doc/tutorial/datastructures.rst
index a0d56274fd7e8..2f7afb088f3bb 100644
--- a/Doc/tutorial/datastructures.rst
+++ b/Doc/tutorial/datastructures.rst
@@ -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:



More information about the Python-checkins mailing list