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 kj
Recipients JelleZijlstra, brandtbucher, gvanrossum, kj, levkivskyi, uriyyo
Date 2021-06-29.10:21:04
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <CAOMZG7iU5JU4Z=9=fgsHEuwkT8mWZzSZmfNCAn=_DTe6Jksi5g@mail.gmail.com>
In-reply-to <1624960847.37.0.227259788863.issue44490@roundup.psfhosted.org>
Content
Yurii, thanks for the offer.

We only need to implement __getitem__ if union supports TypeVars. Which
means __parameters__ need to be implemented too (or at least a private
internal implementation of it).

I interpreted Guido's message above as to wait and see if static type
checkers even accept things like int | list[T]. Maybe he meant that if that
syntax isnt valid then theres no point for us to implement it? PEP 604
leaves out how it deals with TypeVars, so adding this behavior may require
us to update the PEP first (which will require approval from others).

Anyways, there's no rush. We probably can't backport this so we have until
the next minor release of Python (3.11 or later) to decide.
History
Date User Action Args
2021-06-29 10:21:05kjsetrecipients: + kj, gvanrossum, levkivskyi, JelleZijlstra, brandtbucher, uriyyo
2021-06-29 10:21:05kjlinkissue44490 messages
2021-06-29 10:21:04kjcreate