summaryrefslogtreecommitdiffstats
path: root/Lib/types.py
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2022-06-18 14:41:25 (GMT)
committerGitHub <noreply@github.com>2022-06-18 14:41:25 (GMT)
commit579e985e75fd682e314c7b0cce6b1751abe8a7d0 (patch)
tree1e31ad5eb309303a81c0c7ea64d268cb429473fa /Lib/types.py
parent2eff55cd46a55c1eefa8c57b6ab85655dd261fe7 (diff)
downloadcpython-579e985e75fd682e314c7b0cce6b1751abe8a7d0.zip
cpython-579e985e75fd682e314c7b0cce6b1751abe8a7d0.tar.gz
cpython-579e985e75fd682e314c7b0cce6b1751abe8a7d0.tar.bz2
gh-89828: Do not relay the __class__ attribute in GenericAlias (GH-93754)
list[int].__class__ returned type, and isinstance(list[int], type) returned True. It caused numerous problems in code that checks isinstance(x, type). (cherry picked from commit f9433fff476aa13af9cb314fcc6962055faa4085) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Diffstat (limited to 'Lib/types.py')
-rw-r--r--Lib/types.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/Lib/types.py b/Lib/types.py
index 9490da7..2e73fbc 100644
--- a/Lib/types.py
+++ b/Lib/types.py
@@ -80,7 +80,7 @@ def resolve_bases(bases):
updated = False
shift = 0
for i, base in enumerate(bases):
- if isinstance(base, type) and not isinstance(base, GenericAlias):
+ if isinstance(base, type):
continue
if not hasattr(base, "__mro_entries__"):
continue