Hacker News new | ask | show | jobs
by ijl 4519 days ago
In [1]: bool(0)

Out[1]: False

Idiomatic Python may say "if not user_id:" and erroneously skip this.

1 comments

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.