[Python-checkins] cpython (2.7): Issue #28771: Correct documentation of signatures using const
martin.panter
python-checkins at python.org
Wed Nov 30 20:33:12 EST 2016
https://hg.python.org/cpython/rev/2fd070fa6c15
changeset: 105400:2fd070fa6c15
branch: 2.7
parent: 105398:83e3c863594c
user: Martin Panter <vadmium+py at gmail.com>
date: Thu Dec 01 01:32:16 2016 +0000
summary:
Issue #28771: Correct documentation of signatures using const
files:
Doc/c-api/typeobj.rst | 14 ++++++++------
1 files changed, 8 insertions(+), 6 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
@@ -230,8 +230,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
@@ -244,10 +245,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*.
@@ -1450,7 +1452,7 @@
all segments in ``*lenp``. The function cannot fail.
-.. c:type:: Py_ssize_t (*charbufferproc) (PyObject *self, Py_ssize_t segment, const char **ptrptr)
+.. c:type:: Py_ssize_t (*charbufferproc) (PyObject *self, Py_ssize_t segment, char **ptrptr)
Return the size of the segment *segment* that *ptrptr* is set to. ``*ptrptr``
is set to the memory buffer. Returns ``-1`` on error.
--
Repository URL: https://hg.python.org/cpython
More information about the Python-checkins
mailing list