@@ -551,11 +551,11 @@ The following flags can be used with :c:member:`PyMemberDef.flags`:
551551 from ``PyObject ``.
552552
553553 Can only be used as part of :c:member: `Py_tp_members <PyTypeObject.tp_members> `
554- :c:type: `slot <PyTypeSlot > ` when creating a class using negative
554+ :c:type: `slot <PyType_Slot > ` when creating a class using negative
555555 :c:member: `~PyType_Spec.basicsize `.
556556 It is mandatory in that case.
557557
558- This flag is only used in :c:type: `PyTypeSlot `.
558+ This flag is only used in :c:type: `PyType_Slot `.
559559 When setting :c:member: `~PyTypeObject.tp_members ` during
560560 class creation, Python clears it and sets
561561 :c:member: `PyMemberDef.offset ` to the offset from the ``PyObject `` struct.
@@ -693,7 +693,8 @@ Defining Getters and Setters
693693
694694 .. c:member:: setter set
695695
696- Optional C function to set or delete the attribute, if omitted the attribute is readonly.
696+ Optional C function to set or delete the attribute.
697+ If ``NULL``, the attribute is read-only.
697698
698699 .. c:member:: const char* doc
699700
@@ -703,18 +704,18 @@ Defining Getters and Setters
703704
704705 Optional function pointer, providing additional data for getter and setter.
705706
706- The ``get`` function takes one :c:expr:`PyObject*` parameter (the
707- instance) and a function pointer (the associated ``closure ``)::
707+ .. c:type:: PyObject *(*getter)(PyObject *, void *)
708708
709- typedef PyObject *(*getter)(PyObject *, void *);
709+ The ``get `` function takes one :c:expr: `PyObject* ` parameter (the
710+ instance) and a function pointer (the associated ``closure ``):
710711
711712 It should return a new reference on success or ``NULL`` with a set exception
712713 on failure.
713714
714- ``set `` functions take two :c:expr: `PyObject* ` parameters (the instance and
715- the value to be set) and a function pointer (the associated ``closure ``)::
715+ .. c:type:: int (*setter)(PyObject *, PyObject *, void *)
716716
717- typedef int (*setter)(PyObject *, PyObject *, void *);
717+ ``set `` functions take two :c:expr: `PyObject* ` parameters (the instance and
718+ the value to be set) and a function pointer (the associated ``closure ``):
718719
719720 In case the attribute should be deleted the second parameter is ``NULL``.
720721 Should return ``0`` on success or ``-1`` with a set exception on failure.
0 commit comments