summaryrefslogtreecommitdiffstats
path: root/Lib/_collections_abc.py
diff options
context:
space:
mode:
authorNikita Sobolev <mail@sobolevn.me>2023-03-16 14:47:30 (GMT)
committerGitHub <noreply@github.com>2023-03-16 14:47:30 (GMT)
commitfbe82fdd777cead5d6e08ac0d1da19738c19bd81 (patch)
treeb85c7bed7db51840d0b16060c9bbeaec231fe3c7 /Lib/_collections_abc.py
parentb0ec6253c9cf1b22b87cd99f317dbaeb31263b20 (diff)
downloadcpython-fbe82fdd777cead5d6e08ac0d1da19738c19bd81.zip
cpython-fbe82fdd777cead5d6e08ac0d1da19738c19bd81.tar.gz
cpython-fbe82fdd777cead5d6e08ac0d1da19738c19bd81.tar.bz2
gh-102721: Improve coverage of `_collections_abc._CallableGenericAlias` (#102722)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
Diffstat (limited to 'Lib/_collections_abc.py')
-rw-r--r--Lib/_collections_abc.py7
1 files changed, 0 insertions, 7 deletions
diff --git a/Lib/_collections_abc.py b/Lib/_collections_abc.py
index f86b91a..9d7724c 100644
--- a/Lib/_collections_abc.py
+++ b/Lib/_collections_abc.py
@@ -481,15 +481,8 @@ class _CallableGenericAlias(GenericAlias):
# rather than the default types.GenericAlias object. Most of the
# code is copied from typing's _GenericAlias and the builtin
# types.GenericAlias.
-
if not isinstance(item, tuple):
item = (item,)
- # A special case in PEP 612 where if X = Callable[P, int],
- # then X[int, str] == X[[int, str]].
- if (len(self.__parameters__) == 1
- and _is_param_expr(self.__parameters__[0])
- and item and not _is_param_expr(item[0])):
- item = (item,)
new_args = super().__getitem__(item).__args__