a = list()
# do something
if len(a) > 0:
print('a is not empty')
PyLint检查报错:
[C1801(len-as-condition)] Do not use `len(SEQUENCE)` to determine if a sequence is
意思是说 不能使用 len 函数做判断条件
正确的写法:
a = list()
# do something
if a:
print('a is not empty')