top | item 7154752 (no title) ijl | 12 years ago In [1]: bool(0)Out[1]: FalseIdiomatic Python may say "if not user_id:" and erroneously skip this. discuss order hn newest d0mine|12 years ago There is no `NULL` in Python. It is `None`.Idiomatic test for `None` is: if something is None: # ... It would be incorrect to use `if not something:` here.
d0mine|12 years ago There is no `NULL` in Python. It is `None`.Idiomatic test for `None` is: if something is None: # ... It would be incorrect to use `if not something:` here.
d0mine|12 years ago
Idiomatic test for `None` is:
It would be incorrect to use `if not something:` here.