You must log in or register to comment.
I mean this would remove False and None from a list though.
And empty lists, tuples, dictionaries, sets, and strings
results = [result for result in results if result != None]
Should be
is not None
(:You’re right, though IIRC there’s no functional difference when comparing to None (other than speed).
Yes there is. One invokes
__ne__
on the left hand side, the other performs an identity comparison.
results = list(filter(None, results))
Also 0 and empty strings