summaryrefslogtreecommitdiffstats
path: root/Doc/c-api
diff options
context:
space:
mode:
authorMartin Panter <vadmium+py@gmail.com>2016-12-10 05:57:49 (GMT)
committerMartin Panter <vadmium+py@gmail.com>2016-12-10 05:57:49 (GMT)
commitb5e3959e5f0f24a21677fdb491b181fdfa43d491 (patch)
treea9beb14c6ebbb752ad5b923fac18836d28fe484c /Doc/c-api
parent9bcaa37e1cf07795b8e4c602bfb2ad420e6f7391 (diff)
parent21799618ecf3a94c0a93ed56b0ad40af3035ea38 (diff)
downloadcpython-b5e3959e5f0f24a21677fdb491b181fdfa43d491.zip
cpython-b5e3959e5f0f24a21677fdb491b181fdfa43d491.tar.gz
cpython-b5e3959e5f0f24a21677fdb491b181fdfa43d491.tar.bz2
Issue #28771: Merge C API doc fix from 3.6
Diffstat (limited to 'Doc/c-api')
-rw-r--r--Doc/c-api/typeobj.rst12
1 files changed, 7 insertions, 5 deletions
diff --git a/Doc/c-api/typeobj.rst b/Doc/c-api/typeobj.rst
index 4a27d4b..2f0081a 100644
--- a/Doc/c-api/typeobj.rst
+++ b/Doc/c-api/typeobj.rst
@@ -199,8 +199,9 @@ type objects) *must* have the :attr:`ob_size` field.
This field is deprecated. When it is defined, it should point to a function
that acts the same as the :c:member:`~PyTypeObject.tp_getattro` function, but taking a C string
- instead of a Python string object to give the attribute name. The signature is
- the same as for :c:func:`PyObject_GetAttrString`.
+ instead of a Python string object to give the attribute name. The signature is ::
+
+ PyObject * tp_getattr(PyObject *o, char *attr_name);
This field is inherited by subtypes together with :c:member:`~PyTypeObject.tp_getattro`: a subtype
inherits both :c:member:`~PyTypeObject.tp_getattr` and :c:member:`~PyTypeObject.tp_getattro` from its base type when
@@ -213,10 +214,11 @@ type objects) *must* have the :attr:`ob_size` field.
This field is deprecated. When it is defined, it should point to a function
that acts the same as the :c:member:`~PyTypeObject.tp_setattro` function, but taking a C string
- instead of a Python string object to give the attribute name. The signature is
- the same as for :c:func:`PyObject_SetAttrString`, but setting
- *v* to *NULL* to delete an attribute must be supported.
+ instead of a Python string object to give the attribute name. The signature is ::
+
+ PyObject * tp_setattr(PyObject *o, char *attr_name, PyObject *v);
+ The *v* argument is set to *NULL* to delete the attribute.
This field is inherited by subtypes together with :c:member:`~PyTypeObject.tp_setattro`: a subtype
inherits both :c:member:`~PyTypeObject.tp_setattr` and :c:member:`~PyTypeObject.tp_setattro` from its base type when
the subtype's :c:member:`~PyTypeObject.tp_setattr` and :c:member:`~PyTypeObject.tp_setattro` are both *NULL*.