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 AlexWaygood, JelleZijlstra, gvanrossum, kj, matthew.rahtz, mrahtz, serhiy.storchaka
Date 2022-03-19.15:32:54
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1647703974.17.0.900680651016.issue47006@roundup.psfhosted.org>
In-reply-to
Content
I am for consistent behavior. If return GenericAlias(GenericAlias(tuple, Unpack[Ts]), (int, str)) for tuple[*Ts][int, str], we should also return GenericAlias(GenericAlias(list, T), int) for list[T][int], etc. And it will cause multiple problems:

* A repr can be less readable.
* It will break equality comparison and hashing. Good bye caching.
* What about __origin__, __parameters__, __args__? How will they be calculated?
* It can break code which uses annotations for something. For example it can break dataclasses.

It may be that will need to use it as a fallback for cases like tuple[T, *Ts][*Ts2] (currently it is error). But I am not sure that such cases should be supported.
History
Date User Action Args
2022-03-19 15:32:54serhiy.storchakasetrecipients: + serhiy.storchaka, gvanrossum, JelleZijlstra, kj, matthew.rahtz, mrahtz, AlexWaygood
2022-03-19 15:32:54serhiy.storchakasetmessageid: <1647703974.17.0.900680651016.issue47006@roundup.psfhosted.org>
2022-03-19 15:32:54serhiy.storchakalinkissue47006 messages
2022-03-19 15:32:54serhiy.storchakacreate