mirror of
https://github.com/python/cpython.git
synced 2025-08-24 02:35:59 +00:00
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).
This commit is contained in:
parent
084023ccbe
commit
f9433fff47
7 changed files with 18 additions and 20 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue