]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-38558: Link to further docs from walrus operator mention in tutorial (GH-16973)
authorAdorilson Bezerra <adorilson@gmail.com>
Mon, 3 Feb 2020 17:11:19 +0000 (14:11 -0300)
committerGitHub <noreply@github.com>
Mon, 3 Feb 2020 17:11:19 +0000 (18:11 +0100)
Doc/faq/design.rst
Doc/tutorial/datastructures.rst

index 75cd20fb71ddf17d7929605e8009e647074aa5a2..df3dbf4977e01eb55a426376c7f2a4935cff4baa 100644 (file)
@@ -148,6 +148,8 @@ variables and instance variables live in two different namespaces, and you need
 to tell Python which namespace to use.
 
 
+.. _why-can-t-i-use-an-assignment-in-an-expression:
+
 Why can't I use an assignment in an expression?
 -----------------------------------------------
 
index 2f7afb088f3bbbffe6aee9d9975163f17e000204..0edb73ad736919dfe3e941e721b97d52ae9d0078 100644 (file)
@@ -676,9 +676,10 @@ to a variable.  For example, ::
    'Trondheim'
 
 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.
+explicitly with the
+:ref:`walrus operator <why-can-t-i-use-an-assignment-in-an-expression>` ``:=``.
+This avoids a common class of problems encountered in C programs: typing ``=``
+in an expression when ``==`` was intended.
 
 
 .. _tut-comparing: