Why is the use of len(SEQUENCE) in condition values considered incorrect by Pylint?
问题 Considering this code snippet: from os import walk files = [] for (dirpath, _, filenames) in walk(mydir): # more code that modifies files if len(files) == 0: # <-- C1801 return None I was alarmed by Pylint with this message regarding the line with the if statement: [pylint] C1801:Do not use len(SEQUENCE) as condition value The rule C1801, at first glance, did not sound very reasonable to me, and the definition on the reference guide does not explain why this is a problem. In fact, it