Message381643
@guido,
Aesthetics-wise, I agree that ((int, int), str) looks by far the best. My gripe with it lies with the implementation - almost every function in typing currently assumes that every object in __args__ is a type, having (int, int) - the tuple object - requires many changes especially to TypeVar substitution and repr.
I thought that (tuple[int, int], str) looked fine because the positional arguments passed to a function can be represented by a single tuple (and also no need for imports in collections.abc :)! ). However, I support (int, int, str) too for the backwards-compatibility reasons you stated. The only downside to that is that Callable's __args__ will be slightly harder to parse if more args representing other things are added in the future. |
|
Date |
User |
Action |
Args |
2020-11-23 05:59:44 | kj | set | recipients:
+ kj, gvanrossum, serhiy.storchaka, levkivskyi, corona10, Zac Hatfield-Dodds, BTaskaya |
2020-11-23 05:59:44 | kj | set | messageid: <1606111184.84.0.332696830274.issue42195@roundup.psfhosted.org> |
2020-11-23 05:59:44 | kj | link | issue42195 messages |
2020-11-23 05:59:44 | kj | create | |
|