[Haskell-cafe] Re: Python?

John Goerzen jgoerzen at complete.org
Fri May 27 16:57:02 EDT 2005


On 2005-05-11, Daniel Carrera <dcarrera at digitaldistribution.com> wrote:
> ---<snip>---
> # Python implementation of Common Lisp's remove_if
> def remove_if(predicate, lst):
>      return [elem for elem in lst if not predicate(elem)]
>
> print remove_if(lambda x:x % 2, [1,2,3,4,5,6,7,8])
> ---<snip>---
>
> This is so cool. So there we have a higher order function, passing a 
> funtion as an argument, and even lambda notation. Neat.

Yes, but actually much of that is slated for removal from the Python
language in future versions.  See

http://www.python.org/peps/pep-3000.html




More information about the Haskell-Cafe mailing list