On 12/20/06, Guido van Rossum <[EMAIL PROTECTED]> wrote:
> On 12/20/06, Nick Coghlan <[EMAIL PROTECTED]> wrote:
> > I haven't actually tried to implement that, though, and I suspect things 
> > will
> > get a little tricky when it comes to dealing with nested scopes like 
> > '[(lambda
> > i=i: i) for i in range(10)]'.

> That doesn't strike me as tricky; I expect it'll happen automatically
> if you do the right thing.

    [(lambda i=i: i) for i in range(10)]
=>
    [(lambda i=0_i: i) for 0_i in range(10)]

The argument to lambda can't be renamed, because it could be called as
a keyword.

Knowing which i's to rename strikes *me* as tricky, to the point where
I would suggest at least considering a "works as implemented"
pronouncement.  This (along with further nesting, closure variables,
conditionally defined variables, etc) is obscure enough that backwards
incompatibility could be justified, if it made the explanation (or
implementation) simpler.

-jJ
_______________________________________________
Python-3000 mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-3000
Unsubscribe: 
http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com

Reply via email to