使用带有pylint的attr

时间:2017-12-25 21:28:35

标签: python pylint python-attrs

使用attrs package似乎会导致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())

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)

有没有直接的方法如何让玩家熟练使用pylint?

0 个答案:

没有答案