PEP8:
For sequences, (strings, lists, tuples), use the fact that empty sequences are false.
You also can use it with dict and set.
Yes:
if not seq:
if seq:
No:
if len(seq):
if not len(seq):
No:
if seq == []:
if seq != []:
Created at: 2014/03/01 11:42; Updated at: 2016/05/11 04:20