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 JelleZijlstra
Recipients JelleZijlstra, domdfcoding, gvanrossum, joperez, kj, levkivskyi, uriyyo
Date 2021-07-19.18:47:24
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1626720444.36.0.142663134941.issue44353@roundup.psfhosted.org>
In-reply-to
Content
> Using `from __future__ import annotations` it should work

Not in type aliases or generic bases. (And if Larry's co_annotations PEP is accepted, it would break in normal annotations too.) I'd prefer to get rid of this sort of subtle difference where the obvious way to write a type only works in some contexts, though I realize that's not possible in all cases.

That means I think we should move forward with making NewTypes into instances with __call__ instead of functions, though according to my benchmarks in the typing issue that will incur a small performance penalty.
History
Date User Action Args
2021-07-19 18:47:24JelleZijlstrasetrecipients: + JelleZijlstra, gvanrossum, levkivskyi, uriyyo, joperez, domdfcoding, kj
2021-07-19 18:47:24JelleZijlstrasetmessageid: <1626720444.36.0.142663134941.issue44353@roundup.psfhosted.org>
2021-07-19 18:47:24JelleZijlstralinkissue44353 messages
2021-07-19 18:47:24JelleZijlstracreate