Author alexdelorenzo
Recipients alexdelorenzo
Date 2018-08-08.19:41:25
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1533757285.89.0.56676864532.issue34363@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2018-08-08 19:41:25alexdelorenzosetrecipients: + alexdelorenzo
2018-08-08 19:41:25alexdelorenzosetmessageid: <1533757285.89.0.56676864532.issue34363@psf.upfronthosting.co.za>
2018-08-08 19:41:25alexdelorenzolinkissue34363 messages
2018-08-08 19:41:25alexdelorenzocreate