[issue34363] dataclasses.asdict() mishandles dataclass instance attributes that are instances of subclassed typing.NamedTuple

Ivan Levkivskyi report at bugs.python.org
Fri Aug 10 06:57:10 EDT 2018


Ivan Levkivskyi <levkivskyi at gmail.com> added the comment:

Eric, I like your solution. It is probably not perfect, but at least it solves the existing problem without introducing obvious problems.

Neil, your way will not work since named tuples don't have NamedTuple in their MROs:

CustomNT.mro == (CustomNT, tuple, object)

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue34363>
_______________________________________


More information about the Python-bugs-list mailing list