bpo-38558: Link to further docs from walrus operator mention in tutorial (GH-16973)

This commit is contained in:
Adorilson Bezerra 2020-02-03 14:11:19 -03:00 committed by GitHub
parent 49932fec62
commit 5807efd4c3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 3 deletions

View 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?
-----------------------------------------------

View 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: