Expression
not (None in x)
(partners added for clarity) - this is the usual Boolean negation. Nevertheless,
None not in x
special syntax was added for more readable code (there is no possibility here and it makes no sense to use and, or, etc. before entering). If this special case has been added, use it.
The same applies to
foo is not None
against.
not foo is None
I find that βreadingβ is not so clear. As an added bonus, if an expression is part of a larger logical expression, the scope does not immediately become clear.
Ivo van der Wijk
source share