News for hackers. Stuff that matters.
Re:Fastcore: A library that extends Python with new features by jph00 on Saturday September 05, 2020 @03:14PM (#24386129)
I'm the author of fastcore.

dataclasses is not very extensible or flexible. It's fine for starting with, but it's not at all a replacement for store_attr etc.

At fast.ai we used dataclasses extensively for a couple of years, but it just kept biting us. So eventually we switched to these different approaches, which have worked much better for us.

singledispatch is nice enough too, but multiple dispatch with typedispatch is fat more flexible and powerful.

Just because something is in the stdlib, doesn't mean it's the perfect solution to every problem, and that everyone should try to hack their code to fit into those existing solutions.

Re:Fastcore: A library that extends Python with new features by nemetroid on Saturday September 05, 2020 @03:50PM (#24386399)
> dataclasses is not very extensible or flexible. It's fine for starting with, but it's not at all a replacement for store_attr etc.

> At fast.ai we used dataclasses extensively for a couple of years, but it just kept biting us.

What were the issues you had?

Re:Fastcore: A library that extends Python with new features by Recursing on Saturday September 05, 2020 @04:52PM (#24386760)
https://www.attrs.org/en/stable/why.html#data-classes

The most used python library for these things is attrs, I think it mostly provides support for slotted classes (more memory efficient), "converters" (normalization), validation and serialization

Re:Fastcore: A library that extends Python with new features by jph00 on Saturday September 05, 2020 @05:26PM (#24386959)
The key issue is that it requires inheritance, but doesn't actually support subclassing very well.

Also it relies on python's type system, which is rather limited.

It's a very large module for what it does, and understanding all the details of how it works in practice is a big challenge.