(object protocol)
-
PyObject*
Py_NotImplemented (NotImplemented)
-
Py_RETURN_NOTIMPLEMENTED C
Py_NotImplemented( NotImplemented )
-
int
PyObject_HasAttrString(PyObject *o, const char *attr_name) o attr_name
10Pythonhasattr(o, attr_name)
-
PyObject*
PyObject_GetAttr(PyObject *o, PyObject *attr_name) - Return value: New reference.
o attr_name NULL Python
o.attr_name
-
PyObject*
PyObject_GetAttrString(PyObject *o, const char *attr_name) - Return value: New reference.
o attr_name NULL Python
o.attr_name
-
PyObject*
PyObject_GenericGetAttr(PyObject *o, PyObject *name) tp_getattro()__dict__MRO (descriptor)AttributeError
-
int
PyObject_SetAttr(PyObject *o, PyObject *attr_name, PyObject *v) o attr_name v
-1;0Pythono.attr_name = vv NULL
PyObject_DelAttr()
-
int
PyObject_SetAttrString(PyObject *o, const char *attr_name, PyObject *v) o attr_name v
-1;0Pythono.attr_name = vv NULL
PyObject_DelAttrString()
-
int
PyObject_GenericSetAttr(PyObject *o, PyObject *name, PyObject *value) tp_setattroMRO ()__dict__0AttributeError-1
-
int
PyObject_DelAttrString(PyObject *o, const char *attr_name) o attr_name
-1Pythondel o.attr_name
-
int
PyObject_GenericSetDict(PyObject *o, void *context) __dict__setter3.3 .
-
PyObject*
PyObject_RichCompare(PyObject *o1, PyObject *o2, int opid) - Return value: New reference.
o1 o2 opid opid
Py_LT,Py_LE,Py_EQ,Py_NE,Py_GT,Py_GE,<,<=,==,!=,>,>=Pythono1 op o2opopid NULL
-
int
PyObject_RichCompareBool(PyObject *o1, PyObject *o2, int opid) o1 o2 opid opid
Py_LT,Py_LE,Py_EQ,Py_NE,Py_GT,Py_GE,<,<=,==,!=,>,>=10-1Pythono1 op o2opopid
o1 o2 PyObject_RichCompareBool() Py_EQ 1 Py_NE 0
-
PyObject*
PyObject_Repr(PyObject *o) - Return value: New reference.
o NULL Python
repr(o)repr()3.4 :
-
PyObject*
PyObject_ASCII(PyObject *o) PyObject_Repr()oPyObject_Repr()ASCII\x\u\UPythoh 2PyObject_Repr()ascii()
-
PyObject*
PyObject_Str(PyObject *o) - Return value: New reference.
o NULL Python
str(o)str()print()3.4 :
-
int
PyObject_IsSubclass(PyObject *derived, PyObject *cls) derived cls
10-1cls cls 1
110cls
__subclasscheck__()PEP 3119 derived clscls.__mro__type__bases__()
-
int
PyObject_IsInstance(PyObject *inst, PyObject *cls) inst cls cls
10-1cls cls 1
110cls
__instancecheck__()PEP 3119 inst cls clsinst
__class__cls
__bases__()
-
int
PyCallable_Check(PyObject *o) o
10
-
PyObject*
PyObject_Call(PyObject *callable_object, PyObject *args, PyObject *kw) - Return value: New reference.
Python callable_object args (named argument) kw kw NULL args NULL NULL Python
callable_object(*args, **kw)
-
PyObject*
PyObject_CallObject(PyObject *callable_object, PyObject *args) - Return value: New reference.
Python callable_object args args NULL NULL Python
callable_object(*args)
-
PyObject*
PyObject_CallFunction(PyObject *callable, const char *format, ...) - Return value: New reference.
Python callable C C
Py_BuildValue()format NULL NULL Pythoncallable(*args)PyObject *argsPyObject_CallFunctionObjArgs()3.4 : format
char *
-
PyObject*
PyObject_CallMethod(PyObject *o, const char *method, const char *format, ...) - Return value: New reference.
o method C C
Py_BuildValue()format NULL NULL Pythono.method(args)PyObject *argsPyObject_CallMethodObjArgs()3.4 : method format
char *
-
PyObject*
PyObject_CallFunctionObjArgs(PyObject *callable, ..., NULL) - Return value: New reference.
Python callable
PyObject*NULL NULL
-
PyObject*
PyObject_CallMethodObjArgs(PyObject *o, PyObject *name, ..., NULL) - Return value: New reference.
o Python name
PyObject*. NULL NULL
-
Py_hash_t
PyObject_Hash(PyObject *o) o
-1Pythonhash(o)3.2 : Py_hash_t Py_ssize_t
-
int
PyObject_IsTrue(PyObject *o) o
10Pythonnot not o-1
-
int
PyObject_Not(PyObject *o) o
01Pythonnot o-1
-
PyObject*
PyObject_Type(PyObject *o) - Return value: New reference.
o NULL o
SystemErrorNULL Pythontype(o)PyTypeObject*o->ob_type
-
int
PyObject_TypeCheck(PyObject *o, PyTypeObject *type) o type type NULL
-
Py_ssize_t
PyObject_LengthHint(PyObject *o, Py_ssize_t default) o
__length_hint__()Pythonoperator.length_hint(o, default)3.4 .
-
PyObject*
PyObject_GetItem(PyObject *o, PyObject *key) - Return value: New reference.
key o NULL Python
o[key]
-
int
PyObject_DelItem(PyObject *o, PyObject *key) Delete the mapping for key from o. Returns
-1on failure. This is the equivalent of the Python statementdel o[key].
-
PyObject*
PyObject_Dir(PyObject *o) - Return value: New reference.
Python
dir(o)() NULL NULL Pythondir(); NULLPyErr_Occurred()