
On 16/01/13 22:10, Nick Coghlan wrote:
On Wed, Jan 16, 2013 at 8:44 PM, Tarek Ziadé<tarek@ziade.org> wrote:
On 1/16/13 11:33 AM, Laurens Van Houtven wrote:
Hey Tarek,
I would write that as any(x is None for x in it)
But here you're building yet another iterable to adapt it to any(), which seems to me overkill if we can just parametrized the loop in any()
Such a micro-optimization isn't worth the cost of adding a second way to do it that everyone will then need to learn.
For all we know, adding a filter function will be a pessimization, not an optimization, using more memory and/or being slower than using a generator expression. It certainly isn't clear to me that creating a generator expression like (x is None for x in it) is more expensive than creating a filter function like (lambda x: x is None). -1 on adding a filter function. -- Steven