In the generic for statement pseudocode, could explist return a 4th, optional result which is assigned to a scoped variable? I assume a scoped var with value nil is a no-op on exit.dolocal f, s, var, exit_f = explistlocal scoped _exit_f = exit_fwhile true dolocal var_1, ···, var_n = f(s, var)if var_1 == nil then break endvar = var_1blockendendOn Sat, Jul 21, 2018 at 7:55 PM, Roberto Ierusalimschy <roberto@inf.puc-rio.br> wrote:> >From the land of PEP: deterministic cleanup for iterators
>
> https://www.python.org/dev/peps/pep-0533/
>
> Can the prospective scoped locals be applied to this use case?
No. The proposed 'with' clause also does not seem to apply :-)
-- Roberto