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 gvanrossum
Recipients BTaskaya, eric.smith, gvanrossum, lukasz.langa, vstinner, yselivanov
Date 2020-05-27.14:58:41
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1590591521.6.0.958192482153.issue40794@roundup.psfhosted.org>
In-reply-to
Content
To clarify, for Eric: what Batuhan did is effectively adding `from __future__ import annotations` to the top of dataclasses.py.

I believe the root cause is that dataclasses creates functions by synthesizing `def` statements (in _create_fn()) and the annotations there are references to variables in a dedicated namespace. Maybe we should patch the __annotations__ attribute of the result before sticking it into the class?
History
Date User Action Args
2020-05-27 14:58:41gvanrossumsetrecipients: + gvanrossum, vstinner, eric.smith, lukasz.langa, yselivanov, BTaskaya
2020-05-27 14:58:41gvanrossumsetmessageid: <1590591521.6.0.958192482153.issue40794@roundup.psfhosted.org>
2020-05-27 14:58:41gvanrossumlinkissue40794 messages
2020-05-27 14:58:41gvanrossumcreate