Skip to content

Commit e38a525

Browse files
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 697a07a commit e38a525

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
@@ -235,29 +235,30 @@ Implementing functions and methods
235235
Structure used to describe a method of an extension type. This structure has
236236
four fields:
237237
238-
+------------------+---------------+-------------------------------+
239-
| Field | C Type | Meaning |
240-
+==================+===============+===============================+
241-
| :attr:`ml_name` | const char \* | name of the method |
242-
+------------------+---------------+-------------------------------+
243-
| :attr:`ml_meth` | PyCFunction | pointer to the C |
244-
| | | implementation |
245-
+------------------+---------------+-------------------------------+
246-
| :attr:`ml_flags` | int | flag bits indicating how the |
247-
| | | call should be constructed |
248-
+------------------+---------------+-------------------------------+
249-
| :attr:`ml_doc` | const char \* | points to the contents of the |
250-
| | | docstring |
251-
+------------------+---------------+-------------------------------+
238+
.. c:member:: const char* ml_name
239+
240+
name of the method
241+
242+
.. c:member:: PyCFunction ml_meth
243+
244+
pointer to the C implementation
245+
246+
.. c:member:: int ml_flags
247+
248+
flags bits indicating how the call should be constructed
249+
250+
.. c:member:: const char* ml_doc
251+
252+
points to the contents of the docstring
252253
253-
The :attr:`ml_meth` is a C function pointer. The functions may be of different
254+
The :c:member:`ml_meth` is a C function pointer. The functions may be of different
254255
types, but they always return :c:expr:`PyObject*`. If the function is not of
255256
the :c:type:`PyCFunction`, the compiler will require a cast in the method table.
256257
Even though :c:type:`PyCFunction` defines the first parameter as
257258
:c:expr:`PyObject*`, it is common that the method implementation uses the
258259
specific C type of the *self* object.
259260
260-
The :attr:`ml_flags` field is a bitfield which can include the following flags.
261+
The :c:member:`ml_flags` field is a bitfield which can include the following flags.
261262
The individual flags indicate either a calling convention or a binding
262263
convention.
263264

0 commit comments

Comments
 (0)