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

One nice thing about making this decision is that the decision rubric for choosing between dataclasses and attrs is really straightforward. In addition to all the reasons the article lists for why you might need to use dataclasses, I'd personally also default to them unless I know I need one of the things that attrs does better: robust validation, or performance.

The nice thing here is that, since dataclasses are more-or-less just slimmed-down attrs, it's relatively easy to migrate from dataclasses to attrs at a later date.



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

Search: