mirror of https://github.com/python/cpython.git
bpo-39231: correct tutorial annotations section (GH-25029)
This commit is contained in:
parent
bacefbf414
commit
a53e9a7cf5
|
@ -1038,7 +1038,7 @@ function. Parameter annotations are defined by a colon after the parameter name
|
||||||
by an expression evaluating to the value of the annotation. Return annotations are
|
by an expression evaluating to the value of the annotation. Return annotations are
|
||||||
defined by a literal ``->``, followed by an expression, between the parameter
|
defined by a literal ``->``, followed by an expression, between the parameter
|
||||||
list and the colon denoting the end of the :keyword:`def` statement. The
|
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
|
following example has a required argument, an optional argument, and the return
|
||||||
value annotated::
|
value annotated::
|
||||||
|
|
||||||
>>> def f(ham: str, eggs: str = 'eggs') -> str:
|
>>> def f(ham: str, eggs: str = 'eggs') -> str:
|
||||||
|
|
Loading…
Reference in New Issue