You could use ifilterfalse here too and skip the 'not' in your lambda. (http://docs.python.org/2/library/itertools.html#itertools.ifilterfalse)