8000 gh-97908: CAPI docs: Remove repeated struct names from member docs by encukou · Pull Request #100054 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-97908: CAPI docs: Remove repeated struct names from member docs #100054

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
May 29, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Remove duplicate struct names from member docs
  • Loading branch information
encukou committed Dec 6, 2022
commit e2867fdadf982b209b703f0502798daf16c6fc26
12 changes: 6 additions & 6 deletions Doc/c-api/structures.rst
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,7 @@ Accessing attributes of extension types

The string should be static, no copy is made of it.

.. c:member:: Py_ssize_t PyMemberDef.offset
.. c:member:: Py_ssize_t offset

The offset in bytes that the member is located on the type’s object struct.

Expand Down Expand Up @@ -608,23 +608,23 @@ Defining Getters and Setters
Structure to define property-like access for a type. See also description of
the :c:member:`PyTypeObject.tp_getset` slot.

.. c:member:: const char* PyGetSetDef.name
.. c:member:: const char* name

attribute name

.. c:member:: getter PyGetSetDef.get
.. c:member:: getter get

C funtion to get the attribute.

.. c:member:: setter PyGetSetDef.set
.. c:member:: setter set

Optional C function to set or delete the attribute, if omitted the attribute is readonly.

.. c:member:: const char* PyGetSetDef.doc
.. c:member:: const char* doc

optional docstring

.. c:member:: void* PyGetSetDef.closure
.. c:member:: void* closure

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

Expand Down
14 changes: 7 additions & 7 deletions Doc/c-api/type.rst
Original file line number Diff line number Diff line change
Expand Up @@ -322,25 +322,25 @@ The following functions and structs are used to create

Structure defining a type's behavior.

.. c:member:: const char* PyType_Spec.name
.. c:member:: const char* name

Name of the type, used to set :c:member:`PyTypeObject.tp_name`.

.. c:member:: int PyType_Spec.basicsize
.. c:member:: int PyType_Spec.itemsize
.. c:member:: int basicsize
.. c:member:: int itemsize

Size of the instance in bytes, used to set
:c:member:`PyTypeObject.tp_basicsize` and
:c:member:`PyTypeObject.tp_itemsize`.

.. c:member:: int PyType_Spec.flags
.. c:member:: int flags

Type flags, used to set :c:member:`PyTypeObject.tp_flags`.

If the ``Py_TPFLAGS_HEAPTYPE`` flag is not set,
:c:func:`PyType_FromSpecWithBases` sets it automatically.

.. c:member:: PyType_Slot *PyType_Spec.slots
.. c:member:: PyType_Slot *slots

Array of :c:type:`PyType_Slot` structures.
Terminated by the special slot value ``{0, NULL}``.
Expand All @@ -352,7 +352,7 @@ The following functions and structs are used to create
Structure defining optional functionality of a type, containing a slot ID
and a value pointer.

.. c:member:: int PyType_Slot.slot
.. c:member:: int slot

A slot ID.

Expand Down Expand Up @@ -396,7 +396,7 @@ The following functions and structs are used to create
:c:member:`~PyBufferProcs.bf_releasebuffer` are now available
under the limited API.

.. c:member:: void *PyType_Slot.pfunc
.. c:member:: void *pfunc

The desired value of the slot. In most cases, this is a pointer
to a function.
Expand Down
0