Re:Attrs – the Python library everyone needs (2016)
by Spivak on Friday December 24, 2021 @06:46PM
(#29678911)
The advantage of dataclasses is that they’re hard to mess up. They define all the methods you need to have an ergonomic idiomatic class that is essentially a tuple with some methods attached and have enough knobs to encompass basically all “normal” uses of classes.
It’s a pretty good abstraction that doesn’t feel half as magic as it is.
It’s a pretty good abstraction that doesn’t feel half as magic as it is.