bpo-44794: Merge tests for typing.Callable and collection.abc.Callable (GH-27507)

This commit is contained in:
Serhiy Storchaka 2021-07-31 20:05:45 +03:00 committed by GitHub
parent 0ad173249d
commit be4cb9089a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 141 additions and 117 deletions

View file

@ -478,8 +478,7 @@ class _CallableGenericAlias(GenericAlias):
# then X[int, str] == X[[int, str]].
param_len = len(self.__parameters__)
if param_len == 0:
raise TypeError(f'There are no type or parameter specification'
f'variables left in {self}')
raise TypeError(f'{self} is not a generic class')
if (param_len == 1
and isinstance(item, (tuple, list))
and len(item) > 1) or not isinstance(item, tuple):