Passing a parameter to filter
Thomas Heller
theller at python.net
Fri Apr 16 13:34:55 EDT 2004
"Fredrik Lundh" <fredrik at pythonware.com> writes:
> filter(lambda x: f(x, 3), range(20))
>
> [x for x in range(20) if f(x, 3)]
>
> </F>
>
> (this reply will be followed by 20 replies pointing you to 150-line scripts
> that lets you do what you want by a combination of metaclasses, byte-
> code rewriting, and iterators...)
In your list you forgot the additional 20 replies talking about currying
(and the replies to them that currying is something different)
Thomas
More information about the Python-list
mailing list