Using cattrs to structure data and I want to omit x1 string field. I want to perform a trivial cleanup on strings that have been passed in except for the password field. I can get it to work on all strings I can fool cattrs by passing in the adminpass field as Any but this is a bit clunky. The
Tag: python-attrs
Create a customer converter and validator using ATTRS
I am trying to learn attrs and I have two questions. Please note that I am using the ATTRS library, not ATTR. How do I create a converter to change typ to uppercase? —> I solved this question. The formula below is updated. :) How do I create a validator to ensure that typ is contained within a list? I’ve
Passing kwargs to a base classs using python attrs library
I am using the attrs python library for a child class which inherits from a non-attrs base class. I’d like to expose all of the parent parameters to the child via kwargs but cannot figure out how to go about it with attrs. Basic example: I don’t have a huge amount of discretion over the parent class but have seen