checking if two things do not equal None

contact.trigon at contact.trigon at
Sat Mar 29 20:23:25 CET 2014

> Do you actually want to check for arbitrary objects which may claim to  
> equal None, or do you want to check for objects which are None?

Arbitrary objects are not a concern.

> if not (a is b is None): ...
> if a is not b is not None: ...

Thanks for the examples.

More information about the Python-list mailing list