Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

In [1]: bool(0)

Out[1]: False

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




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.




Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: