mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
bpo-35566: Add links to annotation glossary term (GH-11291)
This commit is contained in:
parent
d378b1f8ed
commit
b7105c9c96
4 changed files with 11 additions and 11 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue