[issue34961] Global scoping when shadowing local names in class definitions
New submission from multun : Hello, >>> a="global" >>> def func(a): ... class wtf(): ... a=a ... return wtf ... >>> func("local").a 'global' >>> def func2(a): ... class wtf(): ... b=a ...
[issue34961] Global scoping when shadowing local names in class definitions
multun added the comment: Closing, this is documented, and as such most likely intended. "A class definition is an executable statement that may use and define names. These references follow the normal rules for name resolution with an exception that unbound local variables are looked