5 ms·
In [1]: bool(0) Out[1]: False Idiomatic Python may say "if not user_id:" and erroneously skip this.
by ijl 13y ago
In [1]: bool(0)
Out[1]: False
Idiomatic Python may say "if not user_id:" and erroneously skip this.
- d0mine 13y agoThere 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.