dev*_*vil 5 python pylint python-attrs
使用attrs软件包似乎会导致PyLint错误:
import attr
@attr.s(slots=True)
class Foo:
d = attr.ib(attr.Factory(dict), type=dict)
f = Foo()
print('bar' in f.d)
print(f.d.items())
Run Code Online (Sandbox Code Playgroud)
PyLint抱怨以下错误消息(不相关):
E: 9,15: Value 'f.d' doesn't support membership test (unsupported-membership-test)
E: 10, 6: Instance of '_CountingAttr' has no 'items' member (no-member)
Run Code Online (Sandbox Code Playgroud)
有没有直接的方法如何使pattint与attrs正常工作?
| 归档时间: |
|
| 查看次数: |
548 次 |
| 最近记录: |