@@ -891,6 +891,12 @@ extern bool _PyObject_TryGetInstanceAttribute(PyObject *obj, PyObject *name,
891891extern PyObject * _PyType_LookupRefAndVersion (PyTypeObject * , PyObject * ,
892892 unsigned int * );
893893
894+ // Internal API to look for a name through the MRO.
895+ // This stores a stack reference in out and returns the value of
896+ // type->tp_version or zero if name is missing. It doesn't set an exception!
897+ extern unsigned int
898+ _PyType_LookupStackRefAndVersion (PyTypeObject * type , PyObject * name , _PyStackRef * out );
899+
894900// Cache the provided init method in the specialization cache of type if the
895901// provided type version matches the current version of the type.
896902//
@@ -946,6 +952,14 @@ extern int _PyObject_IsInstanceDictEmpty(PyObject *);
946952PyAPI_FUNC (PyObject * ) _PyObject_LookupSpecial (PyObject * , PyObject * );
947953PyAPI_FUNC (PyObject * ) _PyObject_LookupSpecialMethod (PyObject * self , PyObject * attr , PyObject * * self_or_null );
948954
955+ // Calls the method named `attr` on `self`, but does not set an exception if
956+ // the attribute does not exist.
957+ PyAPI_FUNC (PyObject * )
958+ _PyObject_MaybeCallSpecialNoArgs (PyObject * self , PyObject * attr );
959+
960+ PyAPI_FUNC (PyObject * )
961+ _PyObject_MaybeCallSpecialOneArg (PyObject * self , PyObject * attr , PyObject * arg );
962+
949963extern int _PyObject_IsAbstract (PyObject * );
950964
951965PyAPI_FUNC (int ) _PyObject_GetMethod (PyObject * obj , PyObject * name , PyObject * * method );
0 commit comments