on-internet
← Community

How to specify an __init__ argument that is not a class attribute

Stack Overflow ·

With attrs, how can I specify an __init__ argument that is not a class attribute. e.g. a CRC8 object might be passed some bytes or bytearray in the constructor, but I don't want to store that input, just calculate the CRC and store the result. Is this pattern an example where using a class method is appropriate (as described in this link)? http://www.attrs.org/en/stable/init.html#initialization

Comments

Sign in or sign up to comment and upvote.

No comments yet.