checking if two things do not equal None
contact.trigon at gmail.com
contact.trigon at gmail.com
Sat Mar 29 19:20:09 EDT 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):
or
if (a is not None) and (b is not None):
More information about the Python-list
mailing list