FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

gh-101100: Fix Sphinx warnings in `c-api/structures.rst` by hugovk · Pull Request #113564 · python/cpython · GitHub

/ cpython Public
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .rst  (1) dotfile  (1) All 2 file types selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
19 changes: 10 additions & 9 deletions Doc/c-api/structures.rst
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -517,11 +517,11 @@ The following flags can be used with :c:member:`PyMemberDef.flags`:
from ``PyObject``.

Can only be used as part of :c:member:`Py_tp_members <PyTypeObject.tp_members>`
:c:type:`slot <PyTypeSlot>` when creating a class using negative
:c:type:`slot <PyType_Slot>` when creating a class using negative
:c:member:`~PyType_Spec.basicsize`.
It is mandatory in that case.

This flag is only used in :c:type:`PyTypeSlot`.
This flag is only used in :c:type:`PyType_Slot`.
When setting :c:member:`~PyTypeObject.tp_members` during
class creation, Python clears it and sets
:c:member:`PyMemberDef.offset` to the offset from the ``PyObject`` struct.
Expand Down Expand Up @@ -659,7 +659,8 @@ Defining Getters and Setters

.. c:member:: setter set

Optional C function to set or delete the attribute, if omitted the attribute is readonly.
Optional C function to set or delete the attribute.
If ``NULL``, the attribute is read-only.

.. c:member:: const char* doc

Expand All @@ -669,18 +670,18 @@ Defining Getters and Setters

Optional function pointer, providing additional data for getter and setter.

The ``get`` function takes one :c:expr:`PyObject*` parameter (the
instance) and a function pointer (the associated ``closure``)::
.. c:type:: PyObject *(*getter)(PyObject *, void *)

typedef PyObject *(*getter)(PyObject *, void *);
The ``get`` function takes one :c:expr:`PyObject*` parameter (the
instance) and a function pointer (the associated ``closure``):

It should return a new reference on success or ``NULL`` with a set exception
on failure.

``set`` functions take two :c:expr:`PyObject*` parameters (the instance and
the value to be set) and a function pointer (the associated ``closure``)::
.. c:type:: int (*setter)(PyObject *, PyObject *, void *)

typedef int (*setter)(PyObject *, PyObject *, void *);
``set`` functions take two :c:expr:`PyObject*` parameters (the instance and
the value to be set) and a function pointer (the associated ``closure``):

In case the attribute should be deleted the second parameter is ``NULL``.
Should return ``0`` on success or ``-1`` with a set exception on failure.
1 change: 0 additions & 1 deletion Doc/tools/.nitignore
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ Doc/c-api/memoryview.rst
Doc/c-api/module.rst
Doc/c-api/object.rst
Doc/c-api/stable.rst
Doc/c-api/structures.rst
Doc/c-api/sys.rst
Doc/c-api/type.rst
Doc/c-api/typeobj.rst
Expand Down

Back | FazBrowse Home | New Git URL