top | item 7154752

(no title)

ijl | 12 years ago

In [1]: bool(0)

Out[1]: False

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

discuss

order

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.