Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: