checking if two things do not equal None

contact.trigon at contact.trigon at
Sun Mar 30 00:20:09 CET 2014

Thanks everyone; it has been very educational.

> Dave Angel:
> ...we'll find that two of the alternatives are not even equivalent.

That helped me realize (a,b) != (None, None) is not correct for the function.

It's a case where two parameters have None as the default argument. What I want is to make sure that both are not None. I am now considering:

if None not in (a,b):
if (a is not None) and (b is not None):

More information about the Python-list mailing list