Skip to content

Commit 35cbc0e

Browse files
committed
Merge branch 'main' into gh-115103-qsbr
2 parents f1c3740 + 95ebd45 commit 35cbc0e

File tree

178 files changed

+3728
-1710
lines changed

Some content is hidden

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

178 files changed

+3728
-1710
lines changed

Doc/c-api/buffer.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ without intermediate copying.
2929
Python provides such a facility at the C level in the form of the :ref:`buffer
3030
protocol <bufferobjects>`. This protocol has two sides:
3131

32-
.. index:: single: PyBufferProcs
32+
.. index:: single: PyBufferProcs (C type)
3333

3434
- on the producer side, a type can export a "buffer interface" which allows
3535
objects of that type to expose information about their underlying buffer.

Doc/c-api/code.rst

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,13 @@ bound into a function.
2222
.. c:var:: PyTypeObject PyCode_Type
2323
2424
This is an instance of :c:type:`PyTypeObject` representing the Python
25-
:class:`code` type.
25+
:ref:`code object <code-objects>`.
2626

2727

2828
.. c:function:: int PyCode_Check(PyObject *co)
2929
30-
Return true if *co* is a :class:`code` object. This function always succeeds.
30+
Return true if *co* is a :ref:`code object <code-objects>`.
31+
This function always succeeds.
3132
3233
.. c:function:: int PyCode_GetNumFree(PyCodeObject *co)
3334
@@ -48,7 +49,7 @@ bound into a function.
4849
.. versionchanged:: 3.11
4950
Added ``qualname`` and ``exceptiontable`` parameters.
5051
51-
.. index:: single: PyCode_New
52+
.. index:: single: PyCode_New (C function)
5253
5354
.. versionchanged:: 3.12
5455
@@ -61,7 +62,7 @@ bound into a function.
6162
Similar to :c:func:`PyUnstable_Code_New`, but with an extra "posonlyargcount" for positional-only arguments.
6263
The same caveats that apply to ``PyUnstable_Code_New`` also apply to this function.
6364
64-
.. index:: single: PyCode_NewWithPosOnlyArgs
65+
.. index:: single: PyCode_NewWithPosOnlyArgs (C function)
6566
6667
.. versionadded:: 3.8 as ``PyCode_NewWithPosOnlyArgs``
6768
@@ -220,7 +221,7 @@ may change without deprecation warnings.
220221
*free* will be called on non-``NULL`` data stored under the new index.
221222
Use :c:func:`Py_DecRef` when storing :c:type:`PyObject`.
222223
223-
.. index:: single: _PyEval_RequestCodeExtraIndex
224+
.. index:: single: _PyEval_RequestCodeExtraIndex (C function)
224225
225226
.. versionadded:: 3.6 as ``_PyEval_RequestCodeExtraIndex``
226227
@@ -238,7 +239,7 @@ may change without deprecation warnings.
238239
If no data was set under the index, set *extra* to ``NULL`` and return
239240
0 without setting an exception.
240241
241-
.. index:: single: _PyCode_GetExtra
242+
.. index:: single: _PyCode_GetExtra (C function)
242243
243244
.. versionadded:: 3.6 as ``_PyCode_GetExtra``
244245
@@ -253,7 +254,7 @@ may change without deprecation warnings.
253254
Set the extra data stored under the given index to *extra*.
254255
Return 0 on success. Set an exception and return -1 on failure.
255256
256-
.. index:: single: _PyCode_SetExtra
257+
.. index:: single: _PyCode_SetExtra (C function)
257258
258259
.. versionadded:: 3.6 as ``_PyCode_SetExtra``
259260

Doc/c-api/exceptions.rst

Lines changed: 77 additions & 77 deletions
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ For convenience, some of these functions will always return a
180180
181181
.. c:function:: PyObject* PyErr_SetFromErrno(PyObject *type)
182182
183-
.. index:: single: strerror()
183+
.. index:: single: strerror (C function)
184184
185185
This is a convenience function to raise an exception when a C library function
186186
has returned an error and set the C variable :c:data:`errno`. It constructs a
@@ -396,7 +396,7 @@ an error value).
396396
.. c:function:: int PyErr_ResourceWarning(PyObject *source, Py_ssize_t stack_level, const char *format, ...)
397397
398398
Function similar to :c:func:`PyErr_WarnFormat`, but *category* is
399-
:exc:`ResourceWarning` and it passes *source* to :func:`warnings.WarningMessage`.
399+
:exc:`ResourceWarning` and it passes *source* to :class:`!warnings.WarningMessage`.
400400
401401
.. versionadded:: 3.6
402402
@@ -635,7 +635,7 @@ Signal Handling
635635
636636
.. index::
637637
pair: module; signal
638-
single: SIGINT
638+
single: SIGINT (C macro)
639639
single: KeyboardInterrupt (built-in exception)
640640
641641
This function interacts with Python's signal handling.
@@ -666,7 +666,7 @@ Signal Handling
666666
667667
.. index::
668668
pair: module; signal
669-
single: SIGINT
669+
single: SIGINT (C macro)
670670
single: KeyboardInterrupt (built-in exception)
671671
672672
Simulate the effect of a :c:macro:`!SIGINT` signal arriving.
@@ -732,7 +732,7 @@ Exception Classes
732732
This creates a class object derived from :exc:`Exception` (accessible in C as
733733
:c:data:`PyExc_Exception`).
734734
735-
The :attr:`__module__` attribute of the new class is set to the first part (up
735+
The :attr:`!__module__` attribute of the new class is set to the first part (up
736736
to the last dot) of the *name* argument, and the class name is set to the last
737737
part (after the last dot). The *base* argument can be used to specify alternate
738738
base classes; it can either be only one class or a tuple of classes. The *dict*
@@ -904,8 +904,8 @@ because the :ref:`call protocol <call>` takes care of recursion handling.
904904
905905
Marks a point where a recursive C-level call is about to be performed.
906906
907-
If :c:macro:`USE_STACKCHECK` is defined, this function checks if the OS
908-
stack overflowed using :c:func:`PyOS_CheckStack`. In this is the case, it
907+
If :c:macro:`!USE_STACKCHECK` is defined, this function checks if the OS
908+
stack overflowed using :c:func:`PyOS_CheckStack`. If this is the case, it
909909
sets a :exc:`MemoryError` and returns a nonzero value.
910910
911911
The function then checks if the recursion limit is reached. If this is the
@@ -968,59 +968,59 @@ All standard Python exceptions are available as global variables whose names are
968968
the variables:
969969
970970
.. index::
971-
single: PyExc_BaseException
972-
single: PyExc_Exception
973-
single: PyExc_ArithmeticError
974-
single: PyExc_AssertionError
975-
single: PyExc_AttributeError
976-
single: PyExc_BlockingIOError
977-
single: PyExc_BrokenPipeError
978-
single: PyExc_BufferError
979-
single: PyExc_ChildProcessError
980-
single: PyExc_ConnectionAbortedError
981-
single: PyExc_ConnectionError
982-
single: PyExc_ConnectionRefusedError
983-
single: PyExc_ConnectionResetError
984-
single: PyExc_EOFError
985-
single: PyExc_FileExistsError
986-
single: PyExc_FileNotFoundError
987-
single: PyExc_FloatingPointError
988-
single: PyExc_GeneratorExit
989-
single: PyExc_ImportError
990-
single: PyExc_IndentationError
991-
single: PyExc_IndexError
992-
single: PyExc_InterruptedError
993-
single: PyExc_IsADirectoryError
994-
single: PyExc_KeyError
995-
single: PyExc_KeyboardInterrupt
996-
single: PyExc_LookupError
997-
single: PyExc_MemoryError
998-
single: PyExc_ModuleNotFoundError
999-
single: PyExc_NameError
1000-
single: PyExc_NotADirectoryError
1001-
single: PyExc_NotImplementedError
1002-
single: PyExc_OSError
1003-
single: PyExc_OverflowError
1004-
single: PyExc_PermissionError
1005-
single: PyExc_ProcessLookupError
1006-
single: PyExc_RecursionError
1007-
single: PyExc_ReferenceError
1008-
single: PyExc_RuntimeError
1009-
single: PyExc_StopAsyncIteration
1010-
single: PyExc_StopIteration
1011-
single: PyExc_SyntaxError
1012-
single: PyExc_SystemError
1013-
single: PyExc_SystemExit
1014-
single: PyExc_TabError
1015-
single: PyExc_TimeoutError
1016-
single: PyExc_TypeError
1017-
single: PyExc_UnboundLocalError
1018-
single: PyExc_UnicodeDecodeError
1019-
single: PyExc_UnicodeEncodeError
1020-
single: PyExc_UnicodeError
1021-
single: PyExc_UnicodeTranslateError
1022-
single: PyExc_ValueError
1023-
single: PyExc_ZeroDivisionError
971+
single: PyExc_BaseException (C var)
972+
single: PyExc_Exception (C var)
973+
single: PyExc_ArithmeticError (C var)
974+
single: PyExc_AssertionError (C var)
975+
single: PyExc_AttributeError (C var)
976+
single: PyExc_BlockingIOError (C var)
977+
single: PyExc_BrokenPipeError (C var)
978+
single: PyExc_BufferError (C var)
979+
single: PyExc_ChildProcessError (C var)
980+
single: PyExc_ConnectionAbortedError (C var)
981+
single: PyExc_ConnectionError (C var)
982+
single: PyExc_ConnectionRefusedError (C var)
983+
single: PyExc_ConnectionResetError (C var)
984+
single: PyExc_EOFError (C var)
985+
single: PyExc_FileExistsError (C var)
986+
single: PyExc_FileNotFoundError (C var)
987+
single: PyExc_FloatingPointError (C var)
988+
single: PyExc_GeneratorExit (C var)
989+
single: PyExc_ImportError (C var)
990+
single: PyExc_IndentationError (C var)
991+
single: PyExc_IndexError (C var)
992+
single: PyExc_InterruptedError (C var)
993+
single: PyExc_IsADirectoryError (C var)
994+
single: PyExc_KeyError (C var)
995+
single: PyExc_KeyboardInterrupt (C var)
996+
single: PyExc_LookupError (C var)
997+
single: PyExc_MemoryError (C var)
998+
single: PyExc_ModuleNotFoundError (C var)
999+
single: PyExc_NameError (C var)
1000+
single: PyExc_NotADirectoryError (C var)
1001+
single: PyExc_NotImplementedError (C var)
1002+
single: PyExc_OSError (C var)
1003+
single: PyExc_OverflowError (C var)
1004+
single: PyExc_PermissionError (C var)
1005+
single: PyExc_ProcessLookupError (C var)
1006+
single: PyExc_RecursionError (C var)
1007+
single: PyExc_ReferenceError (C var)
1008+
single: PyExc_RuntimeError (C var)
1009+
single: PyExc_StopAsyncIteration (C var)
1010+
single: PyExc_StopIteration (C var)
1011+
single: PyExc_SyntaxError (C var)
1012+
single: PyExc_SystemError (C var)
1013+
single: PyExc_SystemExit (C var)
1014+
single: PyExc_TabError (C var)
1015+
single: PyExc_TimeoutError (C var)
1016+
single: PyExc_TypeError (C var)
1017+
single: PyExc_UnboundLocalError (C var)
1018+
single: PyExc_UnicodeDecodeError (C var)
1019+
single: PyExc_UnicodeEncodeError (C var)
1020+
single: PyExc_UnicodeError (C var)
1021+
single: PyExc_UnicodeTranslateError (C var)
1022+
single: PyExc_ValueError (C var)
1023+
single: PyExc_ZeroDivisionError (C var)
10241024
10251025
+-----------------------------------------+---------------------------------+----------+
10261026
| C Name | Python Name | Notes |
@@ -1151,18 +1151,18 @@ the variables:
11511151
These are compatibility aliases to :c:data:`PyExc_OSError`:
11521152
11531153
.. index::
1154-
single: PyExc_EnvironmentError
1155-
single: PyExc_IOError
1156-
single: PyExc_WindowsError
1154+
single: PyExc_EnvironmentError (C var)
1155+
single: PyExc_IOError (C var)
1156+
single: PyExc_WindowsError (C var)
11571157
11581158
+-------------------------------------+----------+
11591159
| C Name | Notes |
11601160
+=====================================+==========+
1161-
| :c:data:`PyExc_EnvironmentError` | |
1161+
| :c:data:`!PyExc_EnvironmentError` | |
11621162
+-------------------------------------+----------+
1163-
| :c:data:`PyExc_IOError` | |
1163+
| :c:data:`!PyExc_IOError` | |
11641164
+-------------------------------------+----------+
1165-
| :c:data:`PyExc_WindowsError` | [2]_ |
1165+
| :c:data:`!PyExc_WindowsError` | [2]_ |
11661166
+-------------------------------------+----------+
11671167
11681168
.. versionchanged:: 3.3
@@ -1188,17 +1188,17 @@ names are ``PyExc_`` followed by the Python exception name. These have the type
11881188
the variables:
11891189
11901190
.. index::
1191-
single: PyExc_Warning
1192-
single: PyExc_BytesWarning
1193-
single: PyExc_DeprecationWarning
1194-
single: PyExc_FutureWarning
1195-
single: PyExc_ImportWarning
1196-
single: PyExc_PendingDeprecationWarning
1197-
single: PyExc_ResourceWarning
1198-
single: PyExc_RuntimeWarning
1199-
single: PyExc_SyntaxWarning
1200-
single: PyExc_UnicodeWarning
1201-
single: PyExc_UserWarning
1191+
single: PyExc_Warning (C var)
1192+
single: PyExc_BytesWarning (C var)
1193+
single: PyExc_DeprecationWarning (C var)
1194+
single: PyExc_FutureWarning (C var)
1195+
single: PyExc_ImportWarning (C var)
1196+
single: PyExc_PendingDeprecationWarning (C var)
1197+
single: PyExc_ResourceWarning (C var)
1198+
single: PyExc_RuntimeWarning (C var)
1199+
single: PyExc_SyntaxWarning (C var)
1200+
single: PyExc_UnicodeWarning (C var)
1201+
single: PyExc_UserWarning (C var)
12021202
12031203
+------------------------------------------+---------------------------------+----------+
12041204
| C Name | Python Name | Notes |

Doc/c-api/file.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ the :mod:`io` APIs instead.
9696
9797
.. c:function:: int PyFile_WriteObject(PyObject *obj, PyObject *p, int flags)
9898
99-
.. index:: single: Py_PRINT_RAW
99+
.. index:: single: Py_PRINT_RAW (C macro)
100100
101101
Write object *obj* to file object *p*. The only supported flag for *flags* is
102102
:c:macro:`Py_PRINT_RAW`; if given, the :func:`str` of the object is written

Doc/c-api/gcsupport.rst

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,10 +83,15 @@ rules:
8383
.. versionadded:: 3.12
8484
8585
86-
.. c:function:: TYPE* PyObject_GC_Resize(TYPE, PyVarObject *op, Py_ssize_t newsize)
86+
.. c:macro:: PyObject_GC_Resize(TYPE, op, newsize)
8787
88-
Resize an object allocated by :c:macro:`PyObject_NewVar`. Returns the
89-
resized object or ``NULL`` on failure. *op* must not be tracked by the collector yet.
88+
Resize an object allocated by :c:macro:`PyObject_NewVar`.
89+
Returns the resized object of type ``TYPE*`` (refers to any C type)
90+
or ``NULL`` on failure.
91+
92+
*op* must be of type :c:expr:`PyVarObject *`
93+
and must not be tracked by the collector yet.
94+
*newsize* must be of type :c:type:`Py_ssize_t`.
9095
9196
9297
.. c:function:: void PyObject_GC_Track(PyObject *op)

0 commit comments

Comments
 (0)