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>
<http://bugs.python.org/issue28100>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to