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:
Serhiy Storchaka 2022-06-18 11:34:57 +03:00 committed by GitHub
parent 084023ccbe
commit f9433fff47
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 18 additions and 20 deletions

View file

@ -583,6 +583,7 @@ ga_vectorcall(PyObject *self, PyObject *const *args,
}
static const char* const attr_exceptions[] = {
"__class__",
"__origin__",
"__args__",
"__unpacked__",