Message327424
Another point I'd like to make is that there is no error in either file or interactive if the annotated assignment appears before the `global` declaration like so:
```
x:int = 0
def set_x():
global x
x = 1
# Works fine!
```
The syntax error specifically occurs when the annotated assignment occurs after a `global` declaration in the program, even if the assignment is in a different scope.
Neither the docs nor the PEP say anything about such an ordering constraint. |
|
Date |
User |
Action |
Args |
2018-10-09 16:07:14 | rohanpadhye | set | recipients:
+ rohanpadhye, gvanrossum, serhiy.storchaka, levkivskyi, xtreak |
2018-10-09 16:07:14 | rohanpadhye | set | messageid: <1539101234.87.0.545547206417.issue34939@psf.upfronthosting.co.za> |
2018-10-09 16:07:14 | rohanpadhye | link | issue34939 messages |
2018-10-09 16:07:14 | rohanpadhye | create | |
|