diff options
author | Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> | 2020-02-03 09:17:17 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-02-03 09:17:17 -0800 |
commit | d01ae1b22330992eadc7b2a0842ead544f7e507d (patch) | |
tree | 8c7e69b5915cb48f7a3d6067c839e60172f29ec7 | |
parent | db2f3114b2be4f3ee81a3258a979327d539ab51a (diff) | |
download | cpython-git-d01ae1b22330992eadc7b2a0842ead544f7e507d.tar.gz |
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@gmail.com>
-rw-r--r-- | Doc/faq/design.rst | 2 | ||||
-rw-r--r-- | Doc/tutorial/datastructures.rst | 7 |
2 files changed, 6 insertions, 3 deletions
diff --git a/Doc/faq/design.rst b/Doc/faq/design.rst index 81c0f474ac..e7921baf24 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 2f7afb088f..0edb73ad73 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: |