On 12/31/2020 3:18 PM, Christopher Barker wrote:
On Thu, Dec 31, 2020 at 11:51 AM Eric V. Smith <[email protected]
<mailto:[email protected]>> wrote:
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?
I'm not opposed to it. Since I can't make asdict/astuple go away, I
might as well make them more useful.
Eric
_______________________________________________
Python-ideas mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at
https://mail.python.org/archives/list/[email protected]/message/5DPSJTFYBBBLT6VQTFIXXKQYIQIU2R4C/
Code of Conduct: http://python.org/psf/codeofconduct/