python - Difference between "if x" and "if x is not None" - Stack Overflow - 0 views
-
Benjamin Bandt-Horn on 30 Dec 13In the following cases: test = False test = "" test = 0 test = 0.0 test = [] test = () test = {} test = set() the if test will differ: if test:#False if test is not None:#True