bpo-35169: Improve error messages for forbidden assignments. (GH-10342)

This commit is contained in:
Serhiy Storchaka 2018-11-20 19:27:16 +02:00 committed by GitHub
parent 6c48bf2d9e
commit 97f1efb606
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 140 additions and 96 deletions

View file

@ -1865,12 +1865,12 @@ SyntaxError: assignment to yield expression not possible
>>> def f(): (yield bar) = y
Traceback (most recent call last):
...
SyntaxError: can't assign to yield expression
SyntaxError: cannot assign to yield expression
>>> def f(): (yield bar) += y
Traceback (most recent call last):
...
SyntaxError: can't assign to yield expression
SyntaxError: cannot assign to yield expression
Now check some throw() conditions: