diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2022-06-18 08:34:57 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-06-18 08:34:57 (GMT) |
commit | f9433fff476aa13af9cb314fcc6962055faa4085 (patch) | |
tree | 1e8510f86eda5b339ab35c30127d00d5bf6d57f4 /Objects/genericaliasobject.c | |
parent | 084023ccbeb3bf54a2e19873c6a4b0bec7b617f6 (diff) | |
download | cpython-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 'Objects/genericaliasobject.c')
-rw-r--r-- | Objects/genericaliasobject.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/Objects/genericaliasobject.c b/Objects/genericaliasobject.c index 0a0d0cc..b2636d5 100644 --- a/Objects/genericaliasobject.c +++ b/Objects/genericaliasobject.c @@ -583,6 +583,7 @@ ga_vectorcall(PyObject *self, PyObject *const *args, } static const char* const attr_exceptions[] = { + "__class__", "__origin__", "__args__", "__unpacked__", |