mirror of
https://github.com/python/cpython.git
synced 2025-08-31 14:07:50 +00:00
use the static identifier api for looking up special methods
I had to move the static identifier code from unicodeobject.h to object.h in order for this to work.
This commit is contained in:
parent
cd8991255c
commit
ce79852077
11 changed files with 153 additions and 164 deletions
|
@ -1142,10 +1142,8 @@ dict_subscript(PyDictObject *mp, register PyObject *key)
|
|||
if (!PyDict_CheckExact(mp)) {
|
||||
/* Look up __missing__ method if we're a subclass. */
|
||||
PyObject *missing, *res;
|
||||
static PyObject *missing_str = NULL;
|
||||
missing = _PyObject_LookupSpecial((PyObject *)mp,
|
||||
"__missing__",
|
||||
&missing_str);
|
||||
_Py_IDENTIFIER(__missing__);
|
||||
missing = _PyObject_LookupSpecial((PyObject *)mp, &PyId___missing__);
|
||||
if (missing != NULL) {
|
||||
res = PyObject_CallFunctionObjArgs(missing,
|
||||
key, NULL);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue