Ken Jin <kenjin4...@gmail.com> added the comment:
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. ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue44490> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com