This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

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 <>
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
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: <>
2018-10-04 15:55:03lukasz.langalinkissue34776 messages
2018-10-04 15:55:03lukasz.langacreate