• Proper way to check if sequence is empty.

 

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 != []:
.