From: Ammar Askar Date: Fri, 25 Oct 2019 22:20:05 +0000 (-0400) Subject: bpo-38558: Mention `:=` in conditions tutorial (GH-16919) X-Git-Tag: v3.9.0a1~126 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=cb2cf06b0aad1851f54999497c1b50c381d1fdd8;p=thirdparty%2FPython%2Fcpython.git bpo-38558: Mention `:=` in conditions tutorial (GH-16919) --- diff --git a/Doc/tutorial/datastructures.rst b/Doc/tutorial/datastructures.rst index a0d56274fd7e..2f7afb088f3b 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: