summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdorilson Bezerra <adorilson@gmail.com>2020-02-03 17:11:19 (GMT)
committerGitHub <noreply@github.com>2020-02-03 17:11:19 (GMT)
commit5807efd4c396d5718325e21f5a14e324a77ff77c (patch)
tree5739567370d40e51e489579a0159d6d054a1078d
parent49932fec62c616ec88da52642339d83ae719e924 (diff)
downloadcpython-5807efd4c396d5718325e21f5a14e324a77ff77c.zip
cpython-5807efd4c396d5718325e21f5a14e324a77ff77c.tar.gz
cpython-5807efd4c396d5718325e21f5a14e324a77ff77c.tar.bz2
bpo-38558: Link to further docs from walrus operator mention in tutorial (GH-16973)
-rw-r--r--Doc/faq/design.rst2
-rw-r--r--Doc/tutorial/datastructures.rst7
2 files changed, 6 insertions, 3 deletions
diff --git a/Doc/faq/design.rst b/Doc/faq/design.rst
index 75cd20f..df3dbf4 100644
--- a/Doc/faq/design.rst
+++ b/Doc/faq/design.rst
@@ -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?
-----------------------------------------------
diff --git a/Doc/tutorial/datastructures.rst b/Doc/tutorial/datastructures.rst
index 2f7afb0..0edb73a 100644
--- a/Doc/tutorial/datastructures.rst
+++ b/Doc/tutorial/datastructures.rst
@@ -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: