alex23 <wuwei23 at gmail.com> writes: > Rather than a list comprehension, use a generator expression: > > for item in (x for x in sequence if x is not None): > do_something(x) I much prefer for item in sequence: if x is not None: do_something(x) -- Arnaud