如果我做类似的事情:
new_list = []
new_list.foo()
Run Code Online (Sandbox Code Playgroud)
flake8 不会为 foo() 方法返回错误,因为它不是“列表”方法。
这是正常现象还是我需要配置一些东西?
flake8不处理问题,但PyLint发出警告no-member:
$ pylint test.py
No config file found, using default configuration
************* Module test
C: 1, 0: Missing module docstring (missing-docstring)
C: 1, 0: Invalid constant name "new_list" (invalid-name)
E: 2, 0: Instance of 'list' has no 'foo' member (no-member)
Run Code Online (Sandbox Code Playgroud)
而且,PyCharm 内置的代码分析器也会对未解析的属性发出警告:
| 归档时间: |
|
| 查看次数: |
2699 次 |
| 最近记录: |