[Python-checkins] bpo-38558: Link to further docs from walrus operator mention in tutorial (GH-16973)
Miss Islington (bot)
webhook-mailer at python.org
Mon Feb 3 12:17:25 EST 2020
https://github.com/python/cpython/commit/d01ae1b22330992eadc7b2a0842ead544f7e507d
commit: d01ae1b22330992eadc7b2a0842ead544f7e507d
branch: 3.8
author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com>
committer: GitHub <noreply at github.com>
date: 2020-02-03T09:17:17-08:00
summary:
bpo-38558: Link to further docs from walrus operator mention in tutorial (GH-16973)
(cherry picked from commit 5807efd4c396d5718325e21f5a14e324a77ff77c)
Co-authored-by: Adorilson Bezerra <adorilson at gmail.com>
files:
M Doc/faq/design.rst
M Doc/tutorial/datastructures.rst
diff --git a/Doc/faq/design.rst b/Doc/faq/design.rst
index 81c0f474ac162..e7921baf242f5 100644
--- a/Doc/faq/design.rst
+++ b/Doc/faq/design.rst
@@ -146,6 +146,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 2f7afb088f3bb..0edb73ad73691 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:
More information about the Python-checkins
mailing list