> Implementation details - even just partial sketches - are always
> "busy".  Think of it this way instead:  it's _currently_ the case that
> listcomps & genexps run in a scope S that's the same as the scope C
> that contains them, _except_ that names appearing as `for` targets are
> local to S.  All other names in S resolve to exactly the same scopes
> they resolved to in C (local in C, global in C, nonlocal in C -
> doesn't matter).
>
> What changes now?  Nothing in that high-level description, except that
> a name appearing as a binding expression target in S that's otherwise
> unknown in C establishes that the name is local to C.  That's nothing
> essentially new, though - bindings _always_ establish scopes for
> otherwise-unknown names in Python.


That's a very nice (and short) explanation!

Maybe my distrust is just don't like the new syntax, or that I'am biased
towards using "as".

-- 
Juancarlo *Añez*
_______________________________________________
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