Hacker News new | ask | show | jobs
by foxylad 2918 days ago
I've become a heavy user of attrs, a small library that makes it easy to replace named tuples with a class that automatically includes initialisation and string representation functions.

So I'm very glad to see data classes bringing this to the core language.

1 comments

Why? attrs does it already.
I'm not a python dev, but isn't less dependencies generally better? Or is attrs in Python natively already?
Attrs isn't in python natively. Not sure why less dependencies would be better though.
Every dependency is one more thing that can go wrong in my mind. I always drop them at every opportunity.

There are some exceptions. Like I really don't want form building to be in the standard library, and I don't want to write it myself.

It is nice when your package manager only takes a short manage to fetch and build though, and you can have more confidence that any mistakes will be your own (under your control) rather than someone else's.

One less thing to worry about. Adds to build time etc.
Python does a lot of things that libraries can do. "Batteries included" and whatnot.