New submission from Alex DeLorenzo <alex.delore...@gmail.com>:
Example: from typing import NamedTuple from dataclasses import dataclass, asdict class NamedTupleAttribute(NamedTuple): example: bool = True @dataclass class Data: attr1: bool attr2: NamedTupleAttribute data = Data(True, NamedTupleAttribute(example=True)) namedtuple_attr = asdict(data)['attr2'] print(type(namedtuple_attr.example)) >>> generator One would expect that the printed type would be of type bool. ---------- components: Interpreter Core messages: 323298 nosy: alexdelorenzo priority: normal severity: normal status: open title: dataclasses.asdict() mishandles dataclass instance attributes that are instances of subclassed typing.NamedTuple type: behavior versions: Python 3.7 _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue34363> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com