Considering this code snippet:
from os import walk
files = []
for (dirpath, _, filenames) in walk(mydir):
# More code that modifies files
if len(files) == 0:
Note that the use of len(seq) is in fact required (instead of just checking the bool value of seq) when using NumPy arrays.
a = numpy.array(range(10))
if a:
print "a is not empty"
results in an exception: ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()
And hence for code that uses both Python lists and NumPy arrays, the C1801 message is less than helpful.