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 thomkeh
Recipients AlexWaygood, GBeauregard, JelleZijlstra, eric.smith, thomkeh
Date 2022-04-06.22:47:22
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1649285242.44.0.207528994928.issue47166@roundup.psfhosted.org>
In-reply-to
Content
There is of course no hard reason for not using the global scope. I just often have enums (or other types) that are very closely linked to one class. And it makes sense to me then to have a TypeAlias in that class so that I don't have to import the enum separately.

For normal classes, the nested TypeAlias works completely fine in the type checkers I tested (pyright and mypy). It's just dataclasses that are the problem.

But I see now that there is a general wish to keep the implementation of dataclass simple, which I can understand.
History
Date User Action Args
2022-04-06 22:47:22thomkehsetrecipients: + thomkeh, eric.smith, JelleZijlstra, AlexWaygood, GBeauregard
2022-04-06 22:47:22thomkehsetmessageid: <1649285242.44.0.207528994928.issue47166@roundup.psfhosted.org>
2022-04-06 22:47:22thomkehlinkissue47166 messages
2022-04-06 22:47:22thomkehcreate