free variables /cell objects question

Terry Reedy tjreedy at udel.edu
Tue Jan 23 19:50:12 EST 2007


"Paul Rubin" <"http://phr.cx"@NOSPAM.invalid> wrote in message 
news:7xbqkpbt6c.fsf at ruckus.brouhaha.com...
| or the Python idiom [(lambda i=i: i) for i in range(10)]

While the idiom is commonly written this way, I think it would be clearer 
if the two related but different variables had two different names:
   [(lambda j=i:j) for i in range(10)]

Terry Jan Reedy







More information about the Python-list mailing list