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 joperez
Recipients gvanrossum, joperez, kj, serhiy.storchaka
Date 2021-10-10.07:24:44
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1633850684.31.0.776019239867.issue45418@roundup.psfhosted.org>
In-reply-to
Content
Indeed, sorry, my example was bad. My library was raising at several place, and I've extrapolated about generic substitution.

I've indeed other substitutions (without `TypeVar`), and because they were failing, I've assumed that all of my substitutions were failing; I was wrong about generic one.

For example, if I want to substitute `int | Collection[int]` to `int | list[int]`, I will have to replace `types.UnionType` by `typing.Union` or use `reduce`, while it was not necessary in 3.9 where I could just write `get_origin(tp)[new_args]`.

So I'll have to add some `if` in my code.
History
Date User Action Args
2021-10-10 07:24:44joperezsetrecipients: + joperez, gvanrossum, serhiy.storchaka, kj
2021-10-10 07:24:44joperezsetmessageid: <1633850684.31.0.776019239867.issue45418@roundup.psfhosted.org>
2021-10-10 07:24:44joperezlinkissue45418 messages
2021-10-10 07:24:44joperezcreate