Rohan Padhye added the comment:
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
New submission from Rohan Padhye :
The following code when run as a script file gives syntax error:
```
def set_x():
global x
x = 1
x:int = 0 # SyntaxError: annotated name 'x' can't be global
```
PEP 526 does not seem to forbid this. The error message "annotat