All Questions
Tagged with python-attrs pylint
3
questions
0
votes
0
answers
18
views
Pylint warnings with attrs
I keep getting warnings from pylint while trying to iterate over an attribute in a class that uses the attrs package.
from typing import List
from attrs import define, Factory
@define
class MyClass:
...
1
vote
1
answer
276
views
How to avoid "Method could be a function" warning within attrs custom validation function
Given the following code:
# check.py
import attr
from attr._make import Attribute
@attr.frozen
class Example:
x: int = attr.ib()
@x.validator
def _validate_x(self, _: Attribute, value: ...
7
votes
0
answers
1k
views
Using attr with pylint
Using the attrs package seems to cause errors with 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())...