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 serhiy.storchaka
Recipients gvanrossum, levkivskyi, serhiy.storchaka
Date 2020-04-27.15:57:56
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1588003077.18.0.979842098769.issue40408@roundup.psfhosted.org>
In-reply-to
Content
While trying to replace typing._GenericAlias with GenericAlias I have found that the latter does not support nested type variables.

>>> from typing import *
>>> T = TypeVar('T')
>>> X = List[List[T]]
>>> X.__parameters__
(~T,)
>>> X[int]
typing.List[typing.List[int]]
>>> Y = list[list[T]]
>>> Y.__parameters__
()
>>> Y[int]
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: There are no type variables left in list[list[~T]]
History
Date User Action Args
2020-04-27 15:57:57serhiy.storchakasetrecipients: + serhiy.storchaka, gvanrossum, levkivskyi
2020-04-27 15:57:57serhiy.storchakasetmessageid: <1588003077.18.0.979842098769.issue40408@roundup.psfhosted.org>
2020-04-27 15:57:57serhiy.storchakalinkissue40408 messages
2020-04-27 15:57:56serhiy.storchakacreate