I have:
x = None
Many references I have found so far do the "null" check in the following fashion:
if x is None:
...
(for example, this question).
Whereas throughout my code I have:
if not x:
...
What I am doing currently works as predicted (returns true), but I'd like to know if there are any use cases where it is optimal to perform the check the way it is done in the first example.
Apologies if this is very obvious or if the question has been asked before - I couldn't find the answer to this specific Q on the site.