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
8bcf2629
Commit
8bcf2629
authored
Jun 04, 2019
by
Ivan Levkivskyi
Committed by
GitHub
Jun 04, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
More updates to the annotated assignments docs (GH-13794)
parent
4cdbc452
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
4 deletions
+3
-4
Doc/reference/simple_stmts.rst
Doc/reference/simple_stmts.rst
+3
-4
No files found.
Doc/reference/simple_stmts.rst
View file @
8bcf2629
...
...
@@ -330,10 +330,9 @@ statement, of a variable or attribute annotation and an optional assignment stat
..
productionlist
::
annotated_assignment_stmt
:
`
augtarget
`
":"
`
expression
`
:
[
"="
(`
expression_list
`
|
`
yield_expression
`)]
:
[
"="
(`
starred_expression
`
|
`
yield_expression
`)]
The
difference
from
normal
:
ref
:`
assignment
`
is
that
only
single
target
and
only
single
right
hand
side
value
is
allowed
.
The
difference
from
normal
:
ref
:`
assignment
`
is
that
only
single
target
is
allowed
.
For
simple
names
as
assignment
targets
,
if
in
class
or
module
scope
,
the
annotations
are
evaluated
and
stored
in
a
special
class
or
module
...
...
@@ -369,7 +368,7 @@ target, then the interpreter evaluates the target except for the last
..
versionchanged
::
3.8
Now
annotated
assignments
allow
same
expressions
in
the
right
hand
side
as
the
augmented
assignments
.
Previously
,
some
expressions
(
like
un
-
parenthesized
the
regular
assignments
.
Previously
,
some
expressions
(
like
un
-
parenthesized
tuple
expressions
)
caused
a
syntax
error
.
...
...
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