checking if two things do not equal None

Chris Angelico rosuav at
Sun Mar 30 00:17:49 CET 2014

On Sun, Mar 30, 2014 at 9:46 AM, Tim Chase <tim at> wrote:
> Though am I correct that your iteration tests for equality, while
> mine tests for identity?  Also, my version bails early in the event
> quitting early is possible.  That's particularly useful in the case
> of doing something like
>   if all(x() is None for x in [func1, func2, func3, costly_func]):
>     do_something()

Presumably you mean to actually call those functions, as checking the
identity of a costly function is still cheap :)


More information about the Python-list mailing list