All Questions
Tagged with python-attrs validation
2
questions
1
vote
1
answer
1k
views
Attrs validation checking when an attribute is another attrs object
I have two attrs classes, where one is an attribute of the other. I want to ensure that if a particular value is given to one, there's a particular value in the other.
I've looked at validators, and ...
1
vote
1
answer
2k
views
Python Attrs Trigger Converter while set attribute
While using python-attrs, what is the good way to trigger the converter while set the attribute.
EX:
@attr.s
class A(object):
b = attr.ib(converter=str)
>>> A(b=1)
A(b='1')
>>> ...