From 7b201162cf842485b8b2de9b6989c6ce5ec02160 Mon Sep 17 00:00:00 2001 From: Brett Cannon Date: Tue, 16 Oct 2007 23:26:45 +0000 Subject: [PATCH] Re-order some functions whose parameters differ between PyObject and const char * so that they are next to each other. --- Doc/c-api/abstract.rst | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/Doc/c-api/abstract.rst b/Doc/c-api/abstract.rst index 2bbdc6bd98b..9a539874040 100644 --- a/Doc/c-api/abstract.rst +++ b/Doc/c-api/abstract.rst @@ -31,21 +31,14 @@ Object Protocol instead of the :func:`repr`. -.. cfunction:: int PyObject_HasAttrString(PyObject *o, const char *attr_name) +.. cfunction:: int PyObject_HasAttr(PyObject *o, PyObject *attr_name) Returns ``1`` if *o* has the attribute *attr_name*, and ``0`` otherwise. This is equivalent to the Python expression ``hasattr(o, attr_name)``. This function always succeeds. -.. cfunction:: PyObject* PyObject_GetAttrString(PyObject *o, const char *attr_name) - - Retrieve an attribute named *attr_name* from object *o*. Returns the attribute - value on success, or *NULL* on failure. This is the equivalent of the Python - expression ``o.attr_name``. - - -.. cfunction:: int PyObject_HasAttr(PyObject *o, PyObject *attr_name) +.. cfunction:: int PyObject_HasAttrString(PyObject *o, const char *attr_name) Returns ``1`` if *o* has the attribute *attr_name*, and ``0`` otherwise. This is equivalent to the Python expression ``hasattr(o, attr_name)``. This function @@ -59,11 +52,11 @@ Object Protocol expression ``o.attr_name``. -.. cfunction:: int PyObject_SetAttrString(PyObject *o, const char *attr_name, PyObject *v) +.. cfunction:: PyObject* PyObject_GetAttrString(PyObject *o, const char *attr_name) - Set the value of the attribute named *attr_name*, for object *o*, to the value - *v*. Returns ``-1`` on failure. This is the equivalent of the Python statement - ``o.attr_name = v``. + Retrieve an attribute named *attr_name* from object *o*. Returns the attribute + value on success, or *NULL* on failure. This is the equivalent of the Python + expression ``o.attr_name``. .. cfunction:: int PyObject_SetAttr(PyObject *o, PyObject *attr_name, PyObject *v) @@ -73,10 +66,11 @@ Object Protocol ``o.attr_name = v``. -.. cfunction:: int PyObject_DelAttrString(PyObject *o, const char *attr_name) +.. cfunction:: int PyObject_SetAttrString(PyObject *o, const char *attr_name, PyObject *v) - Delete attribute named *attr_name*, for object *o*. Returns ``-1`` on failure. - This is the equivalent of the Python statement: ``del o.attr_name``. + Set the value of the attribute named *attr_name*, for object *o*, to the value + *v*. Returns ``-1`` on failure. This is the equivalent of the Python statement + ``o.attr_name = v``. .. cfunction:: int PyObject_DelAttr(PyObject *o, PyObject *attr_name) @@ -85,6 +79,12 @@ Object Protocol This is the equivalent of the Python statement ``del o.attr_name``. +.. cfunction:: int PyObject_DelAttrString(PyObject *o, const char *attr_name) + + Delete attribute named *attr_name*, for object *o*. Returns ``-1`` on failure. + This is the equivalent of the Python statement ``del o.attr_name``. + + .. cfunction:: PyObject* PyObject_RichCompare(PyObject *o1, PyObject *o2, int opid) Compare the values of *o1* and *o2* using the operation specified by *opid*,