diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2022-01-27 12:34:55 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-27 12:34:55 (GMT) |
commit | ecfacc362dd7fef7715dcd94f2e2ca6c622ef115 (patch) | |
tree | 3a907fea5ce2b03d03e7c6619e0cf12c4785d2cc /Lib/_collections_abc.py | |
parent | 82bce54614f8116a40454fbbbf96a3fd460ca7df (diff) | |
download | cpython-ecfacc362dd7fef7715dcd94f2e2ca6c622ef115.zip cpython-ecfacc362dd7fef7715dcd94f2e2ca6c622ef115.tar.gz cpython-ecfacc362dd7fef7715dcd94f2e2ca6c622ef115.tar.bz2 |
bpo-44791: Fix substitution of ParamSpec in Concatenate with different parameter expressions (GH-27518)
* Substitution with a list of types returns now a tuple of types.
* Substitution with Concatenate returns now a Concatenate with
concatenated lists of arguments.
* Substitution with Ellipsis is not supported.
Diffstat (limited to 'Lib/_collections_abc.py')
-rw-r--r-- | Lib/_collections_abc.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/Lib/_collections_abc.py b/Lib/_collections_abc.py index 87a9cd2..97913c7 100644 --- a/Lib/_collections_abc.py +++ b/Lib/_collections_abc.py @@ -500,7 +500,10 @@ class _CallableGenericAlias(GenericAlias): if subparams: subargs = tuple(subst[x] for x in subparams) arg = arg[subargs] - new_args.append(arg) + if isinstance(arg, tuple): + new_args.extend(arg) + else: + new_args.append(arg) # args[0] occurs due to things like Z[[int, str, bool]] from PEP 612 if not isinstance(new_args[0], list): |