[Python-ideas] immutable classes [was: pre-PEP: Default Argument Expressions]

Josiah Carlson jcarlson at uci.edu
Tue Feb 20 00:17:53 CET 2007


"Jan Kanis" <jan.kanis at phil.uu.nl> wrote:
[snip]
> lst = []
> for i in range(10):
> 	lst.append(lambda i: i*i)

You must mean something like...
    lambda j: i*j

> <mode=dreaming> I just hope if  
> python were designed today it would have done these. </mode>

Probably not.  Value binding breaks closures.

 - Josiah




More information about the Python-ideas mailing list