[Python-Dev] accumulator display syntax

Guido van Rossum guido at python.org
Tue Oct 21 19:30:50 EDT 2003


> Actually, I consider Samuele's example a good argument in *favor* of
> the idea.  Because of the similarity between listcomps and generator
> expressions (gen-X's? ;) ) it seems late binding of locals would
> lead to people thinking the behavior is a bug.  Since a genex is not
> a function (at least in form) a late binding would be very
> non-obvious and counterintuitive relative to other kinds of
> expressions.

Hm.  We do late binding of globals.  Why shouldn't we do late binding
of locals?  There are lots of corners or the language where if you
expect something else the actual behavior feels like a bug, until
someone explains it to you.  That's no reason to compromise.  It's an
opportunity for education about scopes!

--Guido van Rossum (home page: http://www.python.org/~guido/)



More information about the Python-Dev mailing list