Skip to content

Commit b398d2c

Browse files
committed
Issue python#28771: Correct documentation of signatures using const
1 parent ed82604 commit b398d2c

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

Doc/c-api/typeobj.rst

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -230,8 +230,9 @@ type objects) *must* have the :attr:`ob_size` field.
230230

231231
This field is deprecated. When it is defined, it should point to a function
232232
that acts the same as the :c:member:`~PyTypeObject.tp_getattro` function, but taking a C string
233-
instead of a Python string object to give the attribute name. The signature is
234-
the same as for :c:func:`PyObject_GetAttrString`.
233+
instead of a Python string object to give the attribute name. The signature is ::
234+
235+
PyObject * tp_getattr(PyObject *o, char *attr_name);
235236

236237
This field is inherited by subtypes together with :c:member:`~PyTypeObject.tp_getattro`: a subtype
237238
inherits both :c:member:`~PyTypeObject.tp_getattr` and :c:member:`~PyTypeObject.tp_getattro` from its base type when
@@ -244,10 +245,11 @@ type objects) *must* have the :attr:`ob_size` field.
244245

245246
This field is deprecated. When it is defined, it should point to a function
246247
that acts the same as the :c:member:`~PyTypeObject.tp_setattro` function, but taking a C string
247-
instead of a Python string object to give the attribute name. The signature is
248-
the same as for :c:func:`PyObject_SetAttrString`, but setting
249-
*v* to *NULL* to delete an attribute must be supported.
248+
instead of a Python string object to give the attribute name. The signature is ::
249+
250+
PyObject * tp_setattr(PyObject *o, char *attr_name, PyObject *v);
250251

252+
The *v* argument is set to *NULL* to delete the attribute.
251253
This field is inherited by subtypes together with :c:member:`~PyTypeObject.tp_setattro`: a subtype
252254
inherits both :c:member:`~PyTypeObject.tp_setattr` and :c:member:`~PyTypeObject.tp_setattro` from its base type when
253255
the subtype's :c:member:`~PyTypeObject.tp_setattr` and :c:member:`~PyTypeObject.tp_setattro` are both *NULL*.
@@ -1450,7 +1452,7 @@ member in the :c:type:`PyTypeObject` structure should be *NULL*. Otherwise, the
14501452
all segments in ``*lenp``. The function cannot fail.
14511453

14521454

1453-
.. c:type:: Py_ssize_t (*charbufferproc) (PyObject *self, Py_ssize_t segment, const char **ptrptr)
1455+
.. c:type:: Py_ssize_t (*charbufferproc) (PyObject *self, Py_ssize_t segment, char **ptrptr)
14541456
14551457
Return the size of the segment *segment* that *ptrptr* is set to. ``*ptrptr``
14561458
is set to the memory buffer. Returns ``-1`` on error.

0 commit comments

Comments
 (0)