diff options
author | Cheryl Sabella <cheryl.sabella@gmail.com> | 2018-12-24 05:09:09 (GMT) |
---|---|---|
committer | Raymond Hettinger <rhettinger@users.noreply.github.com> | 2018-12-24 05:09:09 (GMT) |
commit | b7105c9c9663637e4500bfcac75c911e78d9a1c0 (patch) | |
tree | 05bafc47ad9fd747c9ca73a762225b7788e641d8 /Doc/tutorial | |
parent | d378b1f8ed7919f65a89f026bc899204be3773d4 (diff) | |
download | cpython-b7105c9c9663637e4500bfcac75c911e78d9a1c0.zip cpython-b7105c9c9663637e4500bfcac75c911e78d9a1c0.tar.gz cpython-b7105c9c9663637e4500bfcac75c911e78d9a1c0.tar.bz2 |
bpo-35566: Add links to annotation glossary term (GH-11291)
Diffstat (limited to 'Doc/tutorial')
-rw-r--r-- | Doc/tutorial/controlflow.rst | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Doc/tutorial/controlflow.rst b/Doc/tutorial/controlflow.rst index 08eaa66..9057345 100644 --- a/Doc/tutorial/controlflow.rst +++ b/Doc/tutorial/controlflow.rst @@ -682,10 +682,10 @@ Function Annotations information about the types used by user-defined functions (see :pep:`3107` and :pep:`484` for more information). -Annotations are stored in the :attr:`__annotations__` attribute of the function -as a dictionary and have no effect on any other part of the function. Parameter -annotations are defined by a colon after the parameter name, followed by an -expression evaluating to the value of the annotation. Return annotations are +:term:`Annotations <function annotation>` are stored in the :attr:`__annotations__` +attribute of the function as a dictionary and have no effect on any other part of the +function. Parameter annotations are defined by a colon after the parameter name, followed +by an expression evaluating to the value of the annotation. Return annotations are defined by a literal ``->``, followed by an expression, between the parameter list and the colon denoting the end of the :keyword:`def` statement. The following example has a positional argument, a keyword argument, and the return |