Author BTaskaya
Recipients BTaskaya, Mark.Shannon, gvanrossum, larry, lys.nikolaou, pablogsal, serhiy.storchaka
Date 2021-01-18.18:38:18
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
> The use of nonlocal variables in an annotation will be a syntax error in Python 3.10

What is the reasoning for forbidding nonlocal variables (, can't we just treat them like regular variables and leave the value to whom needed to deal with resolving the scope? 

Also, you should preferably clarify other cases regarding the symbol table interaction of annotations. For example this case:

Here is one;
class T:
    def foo(self):
        a: super().bar() = x

And if we are on the road to writing a PEP, maybe we should somehow squeeze issue 42737 somewhere, since the annotations for complex targets are still evaluated and this makes everything a bit problematic and inconsistent. If you need collaboration on the PEP, just let me know ( (I have a patch ready to go for the symbol table to both make annotations ineffective and forbid this stuff but was waiting for issue 42737)
Date User Action Args
2021-01-18 18:38:18BTaskayasetrecipients: + BTaskaya, gvanrossum, larry, Mark.Shannon, serhiy.storchaka, lys.nikolaou, pablogsal
2021-01-18 18:38:18BTaskayasetmessageid: <>
2021-01-18 18:38:18BTaskayalinkissue42725 messages
2021-01-18 18:38:18BTaskayacreate