mirror of
https://github.com/python/cpython.git
synced 2025-08-03 08:34:29 +00:00
Issue #2115: __slot__ attributes setting was 10x slower.
Also correct a possible crash using ABCs. This change is exactly the same as an optimisation done 5 years ago, but on slot *access*: http://svn.python.org/view?view=rev&rev=28297
This commit is contained in:
parent
e9b9b35931
commit
60d6c7f0cc
3 changed files with 23 additions and 1 deletions
|
@ -166,7 +166,7 @@ descr_setcheck(PyDescrObject *descr, PyObject *obj, PyObject *value,
|
|||
int *pres)
|
||||
{
|
||||
assert(obj != NULL);
|
||||
if (!PyObject_IsInstance(obj, (PyObject *)(descr->d_type))) {
|
||||
if (!PyObject_TypeCheck(obj, descr->d_type)) {
|
||||
PyErr_Format(PyExc_TypeError,
|
||||
"descriptor '%.200s' for '%.100s' objects "
|
||||
"doesn't apply to '%.100s' object",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue