<paul.hermeneu...@gmail.com> writes: > I prefer (x is None) and (x is not None). > > This matches the SQL concept of NULL. > > (X = NULL) is not valid since NULL is not a value and cannot be compared > with anything.
The suitably generic SQL operator is "is (not) distinct from", in some dialects of SQL [certainly if you're using NULL directly you can simply use is/is not, but the "distinct from" operators can be used to compare two expressions that may either or both be NULL. "X is not distinct from Y" == "X = Y or X is NULL and Y is NULL" -- https://mail.python.org/mailman/listinfo/python-list