Skip to content

Commit e93d3f2

Browse files
authored
Merge branch 'main' into ctypes-p2p
2 parents 0eeea13 + b273837 commit e93d3f2

File tree

153 files changed

+1482
-768
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

153 files changed

+1482
-768
lines changed

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ repos:
1010
types_or: [c, python, rst]
1111

1212
- repo: https://github.com/sphinx-contrib/sphinx-lint
13-
rev: v0.6.7
13+
rev: v0.6.8
1414
hooks:
1515
- id: sphinx-lint
1616
args: [--enable=default-role]

Doc/c-api/arg.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -555,7 +555,7 @@ Building values
555555
Same as ``s#``.
556556
557557
``u`` (:class:`str`) [const wchar_t \*]
558-
Convert a null-terminated :c:expr:`wchar_t` buffer of Unicode (UTF-16 or UCS-4)
558+
Convert a null-terminated :c:type:`wchar_t` buffer of Unicode (UTF-16 or UCS-4)
559559
data to a Python Unicode object. If the Unicode buffer pointer is ``NULL``,
560560
``None`` is returned.
561561

Doc/c-api/buffer.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ object via :c:func:`PyObject_GetBuffer`. Since the complexity of the logical
225225
structure of the memory can vary drastically, the consumer uses the *flags*
226226
argument to specify the exact buffer type it can handle.
227227

228-
All :c:data:`Py_buffer` fields are unambiguously defined by the request
228+
All :c:type:`Py_buffer` fields are unambiguously defined by the request
229229
type.
230230

231231
request-independent fields
@@ -464,7 +464,7 @@ Buffer-related functions
464464
465465
.. c:function:: Py_ssize_t PyBuffer_SizeFromFormat(const char *format)
466466
467-
Return the implied :c:data:`~Py_buffer.itemsize` from :c:data:`~Py_buffer.format`.
467+
Return the implied :c:member:`~Py_buffer.itemsize` from :c:member:`~Py_buffer.format`.
468468
On error, raise an exception and return -1.
469469
470470
.. versionadded:: 3.9

Doc/c-api/iterator.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Iterator Objects
66
----------------
77

88
Python provides two general-purpose iterator objects. The first, a sequence
9-
iterator, works with an arbitrary sequence supporting the :meth:`__getitem__`
9+
iterator, works with an arbitrary sequence supporting the :meth:`~object.__getitem__`
1010
method. The second works with a callable object and a sentinel value, calling
1111
the callable for each item in the sequence, and ending the iteration when the
1212
sentinel value is returned.

Doc/c-api/mapping.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ See also :c:func:`PyObject_GetItem`, :c:func:`PyObject_SetItem` and
1313
1414
Return ``1`` if the object provides the mapping protocol or supports slicing,
1515
and ``0`` otherwise. Note that it returns ``1`` for Python classes with
16-
a :meth:`__getitem__` method, since in general it is impossible to
16+
a :meth:`~object.__getitem__` method, since in general it is impossible to
1717
determine what type of keys the class supports. This function always succeeds.
1818
1919
@@ -90,7 +90,7 @@ See also :c:func:`PyObject_GetItem`, :c:func:`PyObject_SetItem` and
9090
This is equivalent to the Python expression ``key in o``.
9191
This function always succeeds.
9292
93-
Note that exceptions which occur while calling the :meth:`__getitem__`
93+
Note that exceptions which occur while calling the :meth:`~object.__getitem__`
9494
method will get suppressed.
9595
To get error reporting use :c:func:`PyObject_GetItem()` instead.
9696
@@ -101,7 +101,7 @@ See also :c:func:`PyObject_GetItem`, :c:func:`PyObject_SetItem` and
101101
This is equivalent to the Python expression ``key in o``.
102102
This function always succeeds.
103103
104-
Note that exceptions which occur while calling the :meth:`__getitem__`
104+
Note that exceptions which occur while calling the :meth:`~object.__getitem__`
105105
method and creating a temporary string object will get suppressed.
106106
To get error reporting use :c:func:`PyMapping_GetItemString()` instead.
107107

Doc/c-api/memory.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -581,7 +581,7 @@ that the treatment of negative indices differs from a Python slice):
581581
default).
582582
583583
A serial number, incremented by 1 on each call to a malloc-like or
584-
realloc-like function. Big-endian ``size_t``. If "bad memory" is detected
584+
realloc-like function. Big-endian :c:type:`size_t`. If "bad memory" is detected
585585
later, the serial number gives an excellent way to set a breakpoint on the
586586
next run, to capture the instant at which this block was passed out. The
587587
static function bumpserialno() in obmalloc.c is the only place the serial

Doc/c-api/method.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ Instance Method Objects
77

88
.. index:: pair: object; instancemethod
99

10-
An instance method is a wrapper for a :c:data:`PyCFunction` and the new way
11-
to bind a :c:data:`PyCFunction` to a class object. It replaces the former call
10+
An instance method is a wrapper for a :c:type:`PyCFunction` and the new way
11+
to bind a :c:type:`PyCFunction` to a class object. It replaces the former call
1212
``PyMethod_New(func, NULL, class)``.
1313

1414

Doc/c-api/module.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ or request "multi-phase initialization" by returning the definition struct itsel
145145
146146
.. c:member:: PyModuleDef_Base m_base
147147
148-
Always initialize this member to :c:data:`PyModuleDef_HEAD_INIT`.
148+
Always initialize this member to :c:macro:`PyModuleDef_HEAD_INIT`.
149149
150150
.. c:member:: const char *m_name
151151

Doc/c-api/refcounting.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ of Python objects.
101101
.. warning::
102102
103103
The deallocation function can cause arbitrary Python code to be invoked (e.g.
104-
when a class instance with a :meth:`__del__` method is deallocated). While
104+
when a class instance with a :meth:`~object.__del__` method is deallocated). While
105105
exceptions in such code are not propagated, the executed code has free access to
106106
all Python global variables. This means that any object that is reachable from
107107
a global variable should be in a consistent state before :c:func:`Py_DECREF` is

Doc/c-api/sequence.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Sequence Protocol
99
.. c:function:: int PySequence_Check(PyObject *o)
1010
1111
Return ``1`` if the object provides the sequence protocol, and ``0`` otherwise.
12-
Note that it returns ``1`` for Python classes with a :meth:`__getitem__`
12+
Note that it returns ``1`` for Python classes with a :meth:`~object.__getitem__`
1313
method, unless they are :class:`dict` subclasses, since in general it
1414
is impossible to determine what type of keys the class supports. This
1515
function always succeeds.

0 commit comments

Comments
 (0)