In the PEP 572 threads there's some grumbling about class scopes.

Here's a random brainstorm. How about we change the scoping rules so that
only functions defined with 'def' (or inside one of those) cannot see the
class scope, and comprehensions and lambdas treat the class scope as an
outer scope so they can close over class variables?

Not sure what should happen to nested classes, they should probably be
lumped in with the 'def' scopes.

-- 
--Guido van Rossum (python.org/~guido)
_______________________________________________
Python-ideas mailing list
Python-ideas@python.org
https://mail.python.org/mailman/listinfo/python-ideas
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to