From 662e30d83c259ae36b9d3282ce7345ee9db373f2 Mon Sep 17 00:00:00 2001 From: Ammar Askar Date: Thu, 24 Oct 2019 14:15:08 -0400 Subject: [PATCH 1/2] bpo-38558: Mention `:=` in conditions tutorial. --- Doc/tutorial/datastructures.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Doc/tutorial/datastructures.rst b/Doc/tutorial/datastructures.rst index a0d56274fd7e83..42535cc80aa1a9 100644 --- a/Doc/tutorial/datastructures.rst +++ b/Doc/tutorial/datastructures.rst @@ -675,8 +675,8 @@ 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 +Note that in Python, unlike C, assignment inside expressions must be done +explicitly with the ``:=`` operator. This avoids a common class of problems encountered in C programs: typing ``=`` in an expression when ``==`` was intended. From 5058d1ca1963889b3e7106036a553d6bc87be33b Mon Sep 17 00:00:00 2001 From: Ammar Askar Date: Fri, 25 Oct 2019 12:51:06 -0400 Subject: [PATCH 2/2] Incorporate suggestion to name the operator --- Doc/tutorial/datastructures.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Doc/tutorial/datastructures.rst b/Doc/tutorial/datastructures.rst index 42535cc80aa1a9..2f7afb088f3bbb 100644 --- a/Doc/tutorial/datastructures.rst +++ b/Doc/tutorial/datastructures.rst @@ -676,9 +676,9 @@ to a variable. For example, :: 'Trondheim' Note that in Python, unlike C, assignment inside expressions must be done -explicitly with the ``:=`` operator. This avoids a common class of problems -encountered in C programs: typing ``=`` in an expression when ``==`` was -intended. +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: