Ken Jin <kenjin4...@gmail.com> added the comment:

I don't think we need the types.GenericAlias(int | list[T], str)
workaround. GenericAlias already has code for extracting __parameters__ and
implementing __getitem__. Someone would need to refactor and reuse them for
Union too. That should be enough to trick GenericAlias to treat Union as
another GenericAlias(I don't remember if it checks for __origin__ as well)
and cover other edge cases as well.

@Yurii do you still plan to take this? If not, I'll start working on
something later today.

----------

_______________________________________
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

Reply via email to