]> granicus.if.org Git - python/commitdiff
Update the annotated assignment docs (GH-13757)
authorIvan Levkivskyi <levkivskyi@gmail.com>
Sun, 2 Jun 2019 23:41:00 +0000 (00:41 +0100)
committerGitHub <noreply@github.com>
Sun, 2 Jun 2019 23:41:00 +0000 (00:41 +0100)
Doc/reference/simple_stmts.rst

index af7c0caff627974cbf7613a6d327807f153ea8a9..9c0430da1fb2a4a9d2127bb0468f5f7a485afc91 100644 (file)
@@ -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: