summaryrefslogtreecommitdiffstats
path: root/Lib/typing.py
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2022-06-18 08:34:57 (GMT)
committerGitHub <noreply@github.com>2022-06-18 08:34:57 (GMT)
commitf9433fff476aa13af9cb314fcc6962055faa4085 (patch)
tree1e8510f86eda5b339ab35c30127d00d5bf6d57f4 /Lib/typing.py
parent084023ccbeb3bf54a2e19873c6a4b0bec7b617f6 (diff)
downloadcpython-f9433fff476aa13af9cb314fcc6962055faa4085.zip
cpython-f9433fff476aa13af9cb314fcc6962055faa4085.tar.gz
cpython-f9433fff476aa13af9cb314fcc6962055faa4085.tar.bz2
gh-89828: Do not relay the __class__ attribute in GenericAlias (#93754)
list[int].__class__ returned type, and isinstance(list[int], type) returned True. It caused numerous problems in code that checks isinstance(x, type).
Diffstat (limited to 'Lib/typing.py')
-rw-r--r--Lib/typing.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/Lib/typing.py b/Lib/typing.py
index 25cae7f..1ebc3ce 100644
--- a/Lib/typing.py
+++ b/Lib/typing.py
@@ -1079,7 +1079,7 @@ class TypeVarTuple(_Final, _Immutable, _PickleUsingNameMixin, _root=True):
var_tuple_index = None
fillarg = None
for k, arg in enumerate(args):
- if not (isinstance(arg, type) and not isinstance(arg, GenericAlias)):
+ if not isinstance(arg, type):
subargs = getattr(arg, '__typing_unpacked_tuple_args__', None)
if subargs and len(subargs) == 2 and subargs[-1] is ...:
if var_tuple_index is not None: