Cool, thanks for doing the relevant research.
For my part, I'd like to see an aeefort to move dataclasses forward. Now that they are in the standard library, they do need to remain pretty stable, but there's still room for extending them. But it's a bit hard when ideas and PRs are mingled in with everything else Python.
Maybe a gitHub repo just for dataclasses?
@Eric V. Smith: what do you think? IS there a way to keep them moving forward?
I'm just going to swap dataclasses for actual classes whenever I need inheritance. It seems like a pity though.
For my part, I've gotten around it (for a different reason...) with an extra inheritance dance:
@dataclass
MyClassBase:
....
MyRealClass(MyClassBase, Some_other_baseclass):
def __init__(self., args, kwargs):
dc_args, dc_kwargs = some_magic_with_self.__dataclass_fields__
MyClassBase.__init__(dc_args, dc_kwargs)
super().__init__(self, args, kwargs)
and you could put that __init__ in a mixin to re-use it.
Or, frankly, just give your dataclass some extra fields that are needed by the superclass you want to use.
-CHB