Author lukasz.langa
Recipients drhagen, eric.smith, gregory.p.smith, gvanrossum, ivan, levkivskyi, lukasz.langa, methane, ned.deily, scoder, yselivanov
Date 2018-10-04.15:55:03
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1538668503.52.0.545547206417.issue34776@psf.upfronthosting.co.za>
In-reply-to
Content
Yury, thanks for your patch. I'll review it soon.

Please note that postponed annotations only reveal a problem that we already had if anybody used a string forward reference:

>>> from dataclasses import dataclass
>>> from typing import get_type_hints
>>> class C:
...   pass
...
>>> @dataclass
... class D:
...   c: C
...
>>> @dataclass
... class E:
...   c: "C"
...
>>> get_type_hints(C.__init__)
{}
>>> get_type_hints(D.__init__)
{'c': <class '__main__.C'>, 'return': <class 'NoneType'>}
>>> get_type_hints(E.__init__)
Traceback (most recent call last):
...
NameError: name 'C' is not defined
History
Date User Action Args
2018-10-04 15:55:03lukasz.langasetrecipients: + lukasz.langa, gvanrossum, gregory.p.smith, ivan, scoder, eric.smith, ned.deily, methane, yselivanov, levkivskyi, drhagen
2018-10-04 15:55:03lukasz.langasetmessageid: <1538668503.52.0.545547206417.issue34776@psf.upfronthosting.co.za>
2018-10-04 15:55:03lukasz.langalinkissue34776 messages
2018-10-04 15:55:03lukasz.langacreate