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
82eac26a
Commit
82eac26a
authored
Jun 03, 2019
by
Ivan Levkivskyi
Committed by
GitHub
Jun 03, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update the annotated assignment docs (GH-13757)
parent
3cf7ea12
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
1 deletion
+7
-1
Doc/reference/simple_stmts.rst
Doc/reference/simple_stmts.rst
+7
-1
No files found.
Doc/reference/simple_stmts.rst
View file @
82eac26a
...
...
@@ -329,7 +329,8 @@ Annotated assignment statements
statement
,
of
a
variable
or
attribute
annotation
and
an
optional
assignment
statement
:
..
productionlist
::
annotated_assignment_stmt
:
`
augtarget
`
":"
`
expression
`
[
"="
`
expression
`]
annotated_assignment_stmt
:
`
augtarget
`
":"
`
expression
`
:
[
"="
(`
expression_list
`
|
`
yield_expression
`)]
The
difference
from
normal
:
ref
:`
assignment
`
is
that
only
single
target
and
only
single
right
hand
side
value
is
allowed
.
...
...
@@ -366,6 +367,11 @@ target, then the interpreter evaluates the target except for the last
syntax
for
type
annotations
that
can
be
used
in
static
analysis
tools
and
IDEs
.
..
versionchanged
::
3.8
Now
annotated
assignments
allow
same
expressions
in
the
right
hand
side
as
the
augmented
assignments
.
Previously
,
some
expressions
(
like
un
-
parenthesized
tuple
expressions
)
caused
a
syntax
error
.
..
_assert
:
...
...
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