PEP 312 - Making lambdas implicit worries me, surely it's just the name 'lambda' that is bad...

Erik Max Francis max at alcyone.com
Mon Mar 3 20:16:55 EST 2003


Alexander Schmolck wrote:

> It isn't a major problem, but I can remember that it did
> (infrequently) cause
> me bugs, so it's not all theoretical. Another minor cause of annoyance
> are
> things like this:
> 
>   SOME_GLOBAL_CONST = [(y**2, x**2) for (x,y) in
>      SOME_OTHER_GLOBAL_CONST]
>   del x, y # I could do without this

But that wouldn't be any different than the explicit for loop form:

	SOME_GLOBAL_CONST = []
	for x, y in SOME_OTHER_GLOBAL_CONST:
	    SOME_GLOBAL_CONST.append((y**2, x**2))
	del x, y # you could do without this

-- 
 Erik Max Francis / max at alcyone.com / http://www.alcyone.com/max/
 __ San Jose, CA, USA / 37 20 N 121 53 W / &tSftDotIotE
/  \ I am the king of sorrow
\__/ Sade
    REALpolitik / http://www.realpolitik.com/
 Get your own customized newsfeed online in realtime ... for free!




More information about the Python-list mailing list