]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-89828: Do not relay the __class__ attribute in GenericAlias (#93754)
authorSerhiy Storchaka <storchaka@gmail.com>
Sat, 18 Jun 2022 08:34:57 +0000 (11:34 +0300)
committerGitHub <noreply@github.com>
Sat, 18 Jun 2022 08:34:57 +0000 (11:34 +0300)
commitf9433fff476aa13af9cb314fcc6962055faa4085
tree1e8510f86eda5b339ab35c30127d00d5bf6d57f4
parent084023ccbeb3bf54a2e19873c6a4b0bec7b617f6
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).
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