mirror of
https://github.com/python/cpython.git
synced 2025-12-31 04:23:37 +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
|
|
@ -583,6 +583,7 @@ ga_vectorcall(PyObject *self, PyObject *const *args,
|
|||
}
|
||||
|
||||
static const char* const attr_exceptions[] = {
|
||||
"__class__",
|
||||
"__origin__",
|
||||
"__args__",
|
||||
"__unpacked__",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue