[Python-checkins] cpython (merge 3.5 -> 3.6): Issue #28771: Merge C API doc fix from 3.5

martin.panter python-checkins at python.org
Sat Dec 10 01:11:18 EST 2016


https://hg.python.org/cpython/rev/ee8c8b79d1d5
changeset: 105570:ee8c8b79d1d5
branch: 3.6
parent: 105567:44d0086cc264
parent: 105569:5d51ac0be72a
user: Martin Panter <vadmium+py at gmail.com>
date: Sat Dec 10 05:57:38 2016 +0000
summary:
 Issue #28771: Merge C API doc fix from 3.5
files:
 Doc/c-api/typeobj.rst | 12 +++++++-----
 1 files changed, 7 insertions(+), 5 deletions(-)
diff --git a/Doc/c-api/typeobj.rst b/Doc/c-api/typeobj.rst
--- a/Doc/c-api/typeobj.rst
+++ b/Doc/c-api/typeobj.rst
@@ -199,8 +199,9 @@
 
 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 @@
 
 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*.
-- 
Repository URL: https://hg.python.org/cpython


More information about the Python-checkins mailing list

AltStyle によって変換されたページ (->オリジナル) /