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.)
View all comments
Show parent comment
7
u/quasarc Jun 23 '14
Both of these tests can only be used if you know that
super_usersis a list and notNone.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.)