I'd suggest you just write your own function to do this. I consider
adding dataclasses.asdict and .astuple to be mistakes.
I agree there -- if you want something that can be used like this -- use a dict in the first place :-)
Eric: what do you think about adding a "shallow" (or "deep") flag to dataclasses.asdict()
that would then upack only the top-level dataclass?
Christopher Barker, PhD (Chris)
Python Language Consulting
- Scientific Software Development
- Desktop GUI and Web Development
- wxPython, numpy, scipy, Cython