[Python-ideas] Sublocal scoping at its simplest

Greg Ewing greg.ewing at canterbury.ac.nz
Mon Apr 30 01:54:33 EDT 2018


Chris Angelico wrote:
> 1) Bind the caught exception to a sublocal 'e'
> 2) Execute the suite, with the reference to 'e' seeing the sublocal
> 3) Set the sublocal e to None
> 4) Unbind the sublocal e
> 
> At the unindent, the sublocal name will vanish, and the original 'e'
> will reappear.

That's a reasonable way to define how a sublocal scope
might work. But as far as I can see, the debate is about
whether sublocal scopes are a good idea in the first
place.

-- 
Greg



More information about the Python-ideas mailing list