pythonian way

Warren Postma embed at geocities.com
Fri Feb 25 11:10:43 EST 2000


> Moshe spake:
> > A = filter(lambda x: x != '\n', H.readlines())
> >
> > Hey, that's the first actually Useful-Use-of-Lambda I've seen! :-)
>
> Shhhhhhh!!!!!! Be quiet! Do you want Guido to retroactively pull the
> plug on "lambda, filter, map and reduce" in one fell swoop?
I am not a big fan of the lambda keyword itself, but I now see a million
uses for it.

Does anyone know if Ruby has this:
A = filter( [ x | x != '\n' ], H.readlines())
Ie:
[ <parameters to the block> | <expression including the parameters> ]

Warren





More information about the Python-list mailing list