diff options
Diffstat (limited to 'Include/internal/pycore_object.h')
-rw-r--r-- | Include/internal/pycore_object.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/Include/internal/pycore_object.h b/Include/internal/pycore_object.h index 5e900f5..e5034ff 100644 --- a/Include/internal/pycore_object.h +++ b/Include/internal/pycore_object.h @@ -891,6 +891,12 @@ extern bool _PyObject_TryGetInstanceAttribute(PyObject *obj, PyObject *name, extern PyObject *_PyType_LookupRefAndVersion(PyTypeObject *, PyObject *, unsigned int *); +// Internal API to look for a name through the MRO. +// This stores a stack reference in out and returns the value of +// type->tp_version or zero if name is missing. It doesn't set an exception! +extern unsigned int +_PyType_LookupStackRefAndVersion(PyTypeObject *type, PyObject *name, _PyStackRef *out); + // Cache the provided init method in the specialization cache of type if the // provided type version matches the current version of the type. // @@ -946,6 +952,14 @@ extern int _PyObject_IsInstanceDictEmpty(PyObject *); PyAPI_FUNC(PyObject*) _PyObject_LookupSpecial(PyObject *, PyObject *); PyAPI_FUNC(PyObject*) _PyObject_LookupSpecialMethod(PyObject *self, PyObject *attr, PyObject **self_or_null); +// Calls the method named `attr` on `self`, but does not set an exception if +// the attribute does not exist. +PyAPI_FUNC(PyObject *) +_PyObject_MaybeCallSpecialNoArgs(PyObject *self, PyObject *attr); + +PyAPI_FUNC(PyObject *) +_PyObject_MaybeCallSpecialOneArg(PyObject *self, PyObject *attr, PyObject *arg); + extern int _PyObject_IsAbstract(PyObject *); PyAPI_FUNC(int) _PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method); |