Ka-Ping Yee wrote:

> It dawned on me that you could use this idea to make the whole
> filter/lambda experience vastly more pleasant.  I whipped up a quick
> implementation:
> 
>     >>> from placeholder import _
>     >>> numbers = [5, 9, 56, 34, 1, 24, 37, 89]
>     >>> filter(_ < 30, numbers)
>     [5, 9, 1, 24]
>     >>> map(_ + 10, numbers)
>     [15, 19, 66, 44, 11, 34, 47, 99]
>     >>>
> 
> Look ma, no lambdas!

What does you implementation do for this:

>>> somevar = False
>>> filter(_ and False, numbers)

Reinhold

_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to