[Python-ideas] Allow filter(items)
Shane Green
shane at umbrellacode.com
Tue Aug 6 11:01:58 CEST 2013
On Aug 6, 2013, at 1:25 AM, Chris Angelico <rosuav at gmail.com> wrote:
>> Are `if bool(...)` or `if bool(...) == True` more readable than `if ...`?
That highlights the repetitive–rather that explicit–nature of bool in this application.
The fact is that None symbolized the identity function (as does bool, it would appear) in this case, and it makes perfect sense to replace the identity function f(x) and input x with x itself; it also makes perfect sense to have a filter function that operates on a collection without a predicate, making predicate an optional transformation.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20130806/755ebc9e/attachment-0001.html>
More information about the Python-ideas
mailing list