Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
gh-98852: Add extra type check to avoid a bug with parameterizing gen…
…erics
  • Loading branch information
Eclips4 committed Oct 29, 2022
commit ffae614cda8df36bd8b5905798a09b7d84b2ff8a
2 changes: 2 additions & 0 deletions Lib/typing.py
Original file line number Diff line number Diff line change
Expand Up @@ -1440,6 +1440,8 @@ def _determine_new_args(self, args):
substfunc = getattr(old_arg, '__typing_subst__', None)
if substfunc:
new_arg = substfunc(new_arg_by_param[old_arg])
elif not isinstance(old_arg, (_GenericAlias, GenericAlias, types.UnionType)):
new_arg = old_arg
else:
subparams = getattr(old_arg, '__parameters__', ())
if not subparams:
Expand Down