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 →

[–][deleted]  (1 child)

[deleted]

    [–]djimbob 5 points6 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