Skip to main content

All Questions

5 votes
2 answers
6k views

in a python attrs class, how can I override generated __init__ with my own

So I like to use attr but sometimes I need to do my own thing. can I override the __init__ method with my own? import attr @attr.s(auto_attribs=True) class MyClass: i: int def __init__(...
polo's user avatar
  • 1,412
3 votes
1 answer
1k views

How to pickle python-attrs class functions via cloudpickle?

I'm using cloudpickle to pass functions around, and I'd like to pass an attrs class function via cloudpickle. import pickle import attr @attr.s(auto_attribs=True) class myclass: an_int: int ...
Mr. Buttons's user avatar