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

> dataclasses are, um, classes

So is the case when you use `namedtuple`, which creates a new class. This is not an interesting gotcha.

Classes (the Python language construct) are how you implement records (the language-neutral concept) in Python.

It's ironic that the "There Is Only One Way to Do It" language has multiple bad ways to implement records though.



Consider applying for YC's Winter 2026 batch! Applications are open till Nov 10

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

Search: