Skip to content

Commit 370498b

Browse files
miss-islingtonramvikrams
andauthoredDec 17, 2022
gh-97909: Fix markup for PyMethodDef members (GH-100089)
(cherry picked from commit 8edcb30) Co-authored-by: ram vikram singh <ramvikrams243@gmail.com>
1 parent e3d8578 commit 370498b

File tree

1 file changed

+17
-16
lines changed

1 file changed

+17
-16
lines changed
 

‎Doc/c-api/structures.rst

+17-16
Original file line numberDiff line numberDiff line change
@@ -247,29 +247,30 @@ Implementing functions and methods
247247
Structure used to describe a method of an extension type. This structure has
248248
four fields:
249249
250-
+------------------+---------------+-------------------------------+
251-
| Field | C Type | Meaning |
252-
+==================+===============+===============================+
253-
| :attr:`ml_name` | const char \* | name of the method |
254-
+------------------+---------------+-------------------------------+
255-
| :attr:`ml_meth` | PyCFunction | pointer to the C |
256-
| | | implementation |
257-
+------------------+---------------+-------------------------------+
258-
| :attr:`ml_flags` | int | flag bits indicating how the |
259-
| | | call should be constructed |
260-
+------------------+---------------+-------------------------------+
261-
| :attr:`ml_doc` | const char \* | points to the contents of the |
262-
| | | docstring |
263-
+------------------+---------------+-------------------------------+
250+
.. c:member:: const char* ml_name
251+
252+
name of the method
253+
254+
.. c:member:: PyCFunction ml_meth
255+
256+
pointer to the C implementation
257+
258+
.. c:member:: int ml_flags
259+
260+
flags bits indicating how the call should be constructed
261+
262+
.. c:member:: const char* ml_doc
263+
264+
points to the contents of the docstring
264265
265-
The :attr:`ml_meth` is a C function pointer. The functions may be of different
266+
The :c:member:`ml_meth` is a C function pointer. The functions may be of different
266267
types, but they always return :c:expr:`PyObject*`. If the function is not of
267268
the :c:type:`PyCFunction`, the compiler will require a cast in the method table.
268269
Even though :c:type:`PyCFunction` defines the first parameter as
269270
:c:expr:`PyObject*`, it is common that the method implementation uses the
270271
specific C type of the *self* object.
271272
272-
The :attr:`ml_flags` field is a bitfield which can include the following flags.
273+
The :c:member:`ml_flags` field is a bitfield which can include the following flags.
273274
The individual flags indicate either a calling convention or a binding
274275
convention.
275276

0 commit comments

Comments
 (0)