Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
b7105c9c
Commit
b7105c9c
authored
Dec 24, 2018
by
Cheryl Sabella
Committed by
Raymond Hettinger
Dec 23, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bpo-35566: Add links to annotation glossary term (GH-11291)
parent
d378b1f8
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
11 additions
and
11 deletions
+11
-11
Doc/library/dataclasses.rst
Doc/library/dataclasses.rst
+3
-3
Doc/reference/compound_stmts.rst
Doc/reference/compound_stmts.rst
+2
-2
Doc/reference/simple_stmts.rst
Doc/reference/simple_stmts.rst
+2
-2
Doc/tutorial/controlflow.rst
Doc/tutorial/controlflow.rst
+4
-4
No files found.
Doc/library/dataclasses.rst
View file @
b7105c9c
...
...
@@ -51,9 +51,9 @@ Module-level decorators, classes, and functions
The :func:`dataclass` decorator examines the class to find
``field``\s. A ``field`` is defined as class variable that has a
type annotation. With two exceptions described below, nothing in
:func:`dataclass` examines the type specified in the variable
annotation.
:term:`type annotation <variable annotation>`. With two
exceptions described below, nothing in :func:`dataclass`
examines the type specified in the variable
annotation.
The order of the fields in all of the generated methods is the
order in which they appear in the class definition.
...
...
Doc/reference/compound_stmts.rst
View file @
b7105c9c
...
...
@@ -571,8 +571,8 @@ used keyword arguments.
single: ->; function annotations
single: : (colon); function annotations
Parameters may have an
notations of the form "``: expression``" following the
parameter name. Any parameter may have an annotation
even those of the form
Parameters may have an
:term:`annotation <function annotation>` of the form "``: expression``"
following the parameter name. Any parameter may have an annotation,
even those of the form
``*identifier`` or ``**identifier``. Functions may have "return" annotation of
the form "``-> expression``" after the parameter list. These annotations can be
any valid Python expression. The presence of annotations does not change the
...
...
Doc/reference/simple_stmts.rst
View file @
b7105c9c
...
...
@@ -325,8 +325,8 @@ Annotated assignment statements
single
:
statement
;
assignment
,
annotated
single
:
:
(
colon
);
annotated
variable
Annotation
assignment
is
the
combination
,
in
a
single
statement
,
of
a
variable
or
attribute
annotation
and
an
optional
assignment
statement
:
:
term
:`
Annotation
<
variable
annotation
>`
assignment
is
the
combination
,
in
a
single
statement
,
of
a
variable
or
attribute
annotation
and
an
optional
assignment
statement
:
..
productionlist
::
annotated_assignment_stmt
:
`
augtarget
`
":"
`
expression
`
[
"="
`
expression
`]
...
...
Doc/tutorial/controlflow.rst
View file @
b7105c9c
...
...
@@ -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
a
s 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__`
a
ttribute 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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment