<div dir="ltr"><div>In the PEP 572 threads there's some grumbling about class scopes.<br><br>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?<br><br></div><div>Not sure what should happen to nested classes, they should probably be lumped in with the 'def' scopes.<br></div><div><div><div><br>-- <br><div class="gmail_signature" data-smartmail="gmail_signature">--Guido van Rossum (<a href="http://python.org/~guido" target="_blank">python.org/~guido</a>)</div>
</div></div></div></div>