checking if two things do not equal None
Lele Gaifax
lele at metapensiero.it
Sat Mar 29 15:24:32 EDT 2014
Steven D'Aprano <steve+comp.lang.python at pearwood.info> writes:
> if not (a is b is None): ...
>
> Or if you prefer:
>
> if a is not b is not None: ...
>>> 1 is not 1 is not None
False
So definitely the former!
ciao, lele.
--
nickname: Lele Gaifax | Quando vivrò di quello che ho pensato ieri
real: Emanuele Gaifas | comincerò ad aver paura di chi mi copia.
lele at metapensiero.it | -- Fortunato Depero, 1929.
More information about the Python-list
mailing list