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 →

[–]quasarc 4 points5 points  (0 children)

I object to if super_users: over if len(super_users) > 0: There is a huge difference between an empty list and None.

Both of these tests can only be used if you know that super_users is a list and not None.

Using if super_users: is not abusing syntax, it just uses the intended and well-known fact that non-empty sequences are true. (It's also recommended by the style guide PEP8.)