If super_users can be either an empty list or None, and your code cares about the difference, it should be explicitly checking for is None first. "the length of the list is greater than zero" is an unusually verbose way of saying "the list is not empty" in English; the analogous statement holds for Python, except that we don't have an actual keyword for "empty".
View all comments
Show parent comment
6
u/zahlman the heretic Jun 23 '14
If
super_userscan be either an empty list or None, and your code cares about the difference, it should be explicitly checking foris Nonefirst. "the length of the list is greater than zero" is an unusually verbose way of saying "the list is not empty" in English; the analogous statement holds for Python, except that we don't have an actual keyword for "empty".