]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-89828: Do not relay the __class__ attribute in GenericAlias (GH-93754)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Sat, 18 Jun 2022 14:41:25 +0000 (07:41 -0700)
committerGitHub <noreply@github.com>
Sat, 18 Jun 2022 14:41:25 +0000 (07:41 -0700)
commit579e985e75fd682e314c7b0cce6b1751abe8a7d0
tree1e31ad5eb309303a81c0c7ea64d268cb429473fa
parent2eff55cd46a55c1eefa8c57b6ab85655dd261fe7
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>
Lib/dataclasses.py
Lib/functools.py
Lib/pydoc.py
Lib/types.py
Lib/typing.py
Misc/NEWS.d/next/Core and Builtins/2022-06-12-19-31-56.gh-issue-89828.bq02M7.rst [new file with mode: 0644]
Objects/genericaliasobject.c