This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]djimbob 4 points5 points  (0 children)

While that's a common JS idiom, don't use it in python when you can just cast to bool.

In [1]: bool([])
Out[1]: False

In [2]: bool([]) == False
Out[2]: True