News for hackers. Stuff that matters.
Re:Attrs – the Python library everyone needs (2016) by rguillebert on Friday December 24, 2021 @04:41PM (#29678013)
Namedtuples also behave like tuples, which is great when you want to incrementally turn tuples into classes but if you want an easy way of creating classes, it's probably not a good idea to have them behave like tuples. Plus dataclasses have more features.
Re:Attrs – the Python library everyone needs (2016) by pletnes on Friday December 24, 2021 @06:04PM (#29678652)
There’s also the fact that sometimes you need an actual tuple - in some places (C extensions like numpy, opencv, …) and a dataclass just doesn’t work.