Hacker News new | ask | show | jobs
by willseth 1642 days ago
Someone should tell this person about dataclasses
4 comments

Attrs was mentioned in the PEP [0] for dataclasses.

[0] https://www.python.org/dev/peps/pep-0557/#why-not-just-use-a...

Exactly
I mean, the blog post is older than dataclasses
Great, maybe OP shouldn’t post and people shouldn’t upvote outdated blog posts with bad advice
I started a project with dataclasses and quickly ran into their limitations (which are by design) and migrated to attrs. It's quite a bit better.

If you take 10 seconds to read attrs website they do go over the differences and maybe discussing those would be more valuable than some cheap snark.

I know what attrs is, thanks. “Everyone should use X library” is always bad advice, and it’s especially bad when there is language native functionality that covers common use cases for the library. Python has a dependency problem, maybe we shouldn’t make it worse with libraries most people don’t need.
dataclasses was explicitly inspired by attrs. https://github.com/ericvsmith/dataclasses/issues/1
Thank you for reinforcing my point