pylint 中出现无效语法

Invalid syntax showing up in pylint

此 python 代码显示此无效语法 (, line 16) pylint(syntax-error)[15,10] 此处错误显示在分号 (:)

for record in colleges:
    obj.writerow([record['collegeId'], record['collegeName'], record['courseType'], record['city'], record['fees'], record['pinCode']])

假设 obj 是 csv.Writer。话虽如此,你好像只是少了一个冒号?

for record in colleges:
    obj.writerow([
        record['collegeId'],
        record['collegeName'],
        record['courseType'],
        record['city'],
        record['fees'],
        record['pinCode']
    ])