Skip to main content

All 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 ...
baxx's user avatar
  • 4,338
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') >>> ...
lucemia's user avatar
  • 6,527