Message368535
@Serhiy can you look at this? A possible fix might be:
diff --git a/Lib/typing.py b/Lib/typing.py
index 681ab6d21e..adcef1e82b 100644
--- a/Lib/typing.py
+++ b/Lib/typing.py
@@ -701,7 +701,8 @@ class _GenericAlias(_BaseGenericAlias, _root=True):
arg = subst[arg]
elif isinstance(arg, (_BaseGenericAlias, GenericAlias)):
subargs = tuple(subst[x] for x in arg.__parameters__)
- arg = arg[subargs]
+ if subargs:
+ arg = arg[subargs]
new_args.append(arg)
return self.copy_with(tuple(new_args))
The immediate cause of the problem seems to be that we call arg[subargs] with subargs being (). So arg is a _GenericAlias but its __parameters__ is (). I'm not sure what path was taken previously. :-( |
|
Date |
User |
Action |
Args |
2020-05-09 19:17:34 | gvanrossum | set | recipients:
+ gvanrossum, serhiy.storchaka, levkivskyi, JelleZijlstra |
2020-05-09 19:17:34 | gvanrossum | set | messageid: <1589051854.85.0.488848728134.issue40397@roundup.psfhosted.org> |
2020-05-09 19:17:34 | gvanrossum | link | issue40397 messages |
2020-05-09 19:17:34 | gvanrossum | create | |
|