@@ -387,27 +387,27 @@ Accessing attributes of extension types
387387 Structure which describes an attribute of a type which corresponds to a C
388388 struct member. Its fields are:
389389
390- +------------------+---------------+-------------------------------+
391- | Field | C Type | Meaning |
392- +==================+===============+===============================+
393- | :attr:`name` | const char \* | name of the member |
394- +------------------+---------------+-------------------------------+
395- | :attr:`!type` | int | the type of the member in the |
396- | | | C struct |
397- +------------------+---------------+-------------------------------+
398- | :attr:`offset` | Py_ssize_t | the offset in bytes that the |
399- | | | member is located on the |
400- | | | type's object struct |
401- +------------------+---------------+-------------------------------+
402- | :attr:`flags` | int | flag bits indicating if the |
403- | | | field should be read-only or |
404- | | | writable |
405- +------------------+---------------+-------------------------------+
406- | :attr:`doc` | const char \* | points to the contents of the |
407- | | | docstring |
408- +------------------+---------------+-------------------------------+
390+ .. c:member:: const char* PyMemberDef.name
391+
392+ Name of the member
393+
394+ .. c:member:: int PyMemberDef.type
395+
396+ The type of the member in the C struct.
397+
398+ .. c:member:: Py_ssize_t PyMemberDef.offset
399+
400+ The offset in bytes that the member is located on the type’s object struct.
409401
410- :attr:`!type` can be one of many ``T_`` macros corresponding to various C
402+ .. c:member:: int PyMemberDef.flags
403+
404+ Flag bits indicating if the field should be read-only or writable.
405+
406+ .. c:member:: const char* PyMemberDef.doc
407+
408+ Points to the contents of the docstring.
409+
410+ :c:member:`PyMemberDef.type` can be one of many ``T_`` macros corresponding to various C
411411 types. When the member is accessed in Python, it will be converted to the
412412 equivalent Python type.
413413
@@ -441,7 +441,7 @@ Accessing attributes of extension types
441441 handles use of the :keyword:`del` statement on that attribute more correctly
442442 than :c:macro:`T_OBJECT`.
443443
444- :attr:` flags` can be ``0`` for write and read access or :c:macro:`READONLY` for
444+ :c:member:`PyMemberDef. flags` can be ``0`` for write and read access or :c:macro:`READONLY` for
445445 read-only access. Using :c:macro:`T_STRING` for :attr:`type` implies
446446 :c:macro:`READONLY`. :c:macro:`T_STRING` data is interpreted as UTF-8.
447447 Only :c:macro:`T_OBJECT` and :c:macro:`T_OBJECT_EX`
@@ -485,23 +485,25 @@ Accessing attributes of extension types
485485 Structure to define property-like access for a type. See also description of
486486 the :c:member: `PyTypeObject.tp_getset ` slot.
487487
488- +-------------+------------------+-----------------------------------+
489- | Field | C Type | Meaning |
490- +=============+==================+===================================+
491- | name | const char \* | attribute name |
492- +-------------+------------------+-----------------------------------+
493- | get | getter | C function to get the attribute |
494- +-------------+------------------+-----------------------------------+
495- | set | setter | optional C function to set or |
496- | | | delete the attribute, if omitted |
497- | | | the attribute is readonly |
498- +-------------+------------------+-----------------------------------+
499- | doc | const char \* | optional docstring |
500- +-------------+------------------+-----------------------------------+
501- | closure | void \* | optional function pointer, |
502- | | | providing additional data for |
503- | | | getter and setter |
504- +-------------+------------------+-----------------------------------+
488+ .. c :member :: const char * PyGetSetDef.name
489+
490+ attribute name
491+
492+ .. c :member :: getter PyGetSetDef.get
493+
494+ C funtion to get the attribute.
495+
496+ .. c :member :: setter PyGetSetDef.set
497+
498+ Optional C function to set or delete the attribute, if omitted the attribute is readonly.
499+
500+ .. c :member :: const char * PyGetSetDef.doc
501+
502+ optional docstring
503+
504+ .. c :member :: void * PyGetSetDef.closure
505+
506+ Optional function pointer, providing additional data for getter and setter.
505507
506508 The ``get `` function takes one :c:expr: `PyObject* ` parameter (the
507509 instance) and a function pointer (the associated ``closure ``)::
0 commit comments