Closed eltoder closed 8 months ago
I guess this is because the automatic union disambiguation (based on unique fields) is exclusively for attrs classes (see https://catt.rs/en/stable/structuring.html#automatic-disambiguation).
Ah, yeah. The easiest fix here would be to just support dataclasses for the default disambiguator. I think it's an easy and useful change. But not in the next release, since it's getting bloated already.
As for the other issue, feel free to open a new ticket and we can triage it.
Description
According to the documentation, include_subclasses() supports both attrs and dataclasses. However, when I change the example to use dataclasses, I get an error:
produces
It does work if I use
union_strategy
:Additionally, when
union_strategy=configure_tagged_union
is used, it would be nice to avoid using__subclasses__
so that new classes can be added dynamically. Let me know if you want me to open a separate issue for this.