Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit8edcb30

Browse files
authored
pythongh-97909: Fix markup forPyMethodDef members (python#100089)
1 parenta6f82f1 commit8edcb30

File tree

1 file changed

+18
-17
lines changed

1 file changed

+18
-17
lines changed

‎Doc/c-api/structures.rst‎

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -228,29 +228,30 @@ Implementing functions and methods
228228
Structure used to describe a method of an extension type. This structure has
229229
four fields:
230230
231-
+------------------+---------------+-------------------------------+
232-
| Field| C Type| Meaning|
233-
+==================+===============+===============================+
234-
|:attr:`ml_name`| const char\*| name of the method|
235-
+------------------+---------------+-------------------------------+
236-
|:attr:`ml_meth`| PyCFunction| pointer to the C|
237-
||| implementation|
238-
+------------------+---------------+-------------------------------+
239-
|:attr:`ml_flags`| int| flag bits indicating how the|
240-
||| call should be constructed|
241-
+------------------+---------------+-------------------------------+
242-
|:attr:`ml_doc`| const char\*| points to the contents of the|
243-
||| docstring|
244-
+------------------+---------------+-------------------------------+
245-
246-
The:attr:`ml_meth` is a C function pointer. The functions may be of different
231+
..c:member::constchar* ml_name
232+
233+
name of the method
234+
235+
..c:member:: PyCFunction ml_meth
236+
237+
pointer to the C implementation
238+
239+
..c:member::int ml_flags
240+
241+
flags bits indicating how the call should be constructed
242+
243+
..c:member::constchar* ml_doc
244+
245+
points to the contents of the docstring
246+
247+
The:c:member:`ml_meth` is a C function pointer. The functions may be of different
247248
types, but they always return:c:expr:`PyObject*`. If the function is not of
248249
the:c:type:`PyCFunction`, the compiler will require a cast in the method table.
249250
Even though:c:type:`PyCFunction` defines the first parameter as
250251
:c:expr:`PyObject*`, it is common that the method implementation uses the
251252
specific C type of the *self* object.
252253
253-
The:attr:`ml_flags` field is a bitfield which can include the following flags.
254+
The:c:member:`ml_flags` field is a bitfield which can include the following flags.
254255
The individual flags indicate either a calling convention or a binding
255256
convention.
256257

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp