Ivan Levkivskyi added the comment:

Here is the patch for 3.6 with requested changes.

While playing with this a bit more, I discovered that the error message in this 
case (if no value is actually assigned):

def f():
    x: int
    global x

could be misleading. Therefore I changed the order of DEF_LOCAL and DEF_ANNOT 
to get a more clear error message for such cases (this does not spoil error 
messages in other cases).

Added file: http://bugs.python.org/file44782/refactor-error-msg-v2.diff

Python tracker <rep...@bugs.python.org>
Python-bugs-list mailing list

Reply via email to