Skip to content

Commit 8a2b6fa

Browse files
Merge branch 'main' into fix-argparse-string-like-help
2 parents 9b6cffe + 6b217ea commit 8a2b6fa

120 files changed

Lines changed: 2967 additions & 2123 deletions

File tree

Some content is hidden

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

.github/workflows/reusable-san.yml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -82,19 +82,16 @@ jobs:
8282
run: make -j4
8383
- name: Display build info
8484
run: make pythoninfo
85-
# test_{capi,faulthandler} are skipped under UBSan because
86-
# they raise signals that UBSan with halt_on_error=1 intercepts.
8785
- name: Tests
8886
run: >-
8987
./python -m test
9088
${{ inputs.sanitizer == 'TSan' && '--tsan' || '' }}
91-
${{ inputs.sanitizer == 'UBSan' && '-x test_capi -x test_faulthandler' || '' }}
92-
-j4
89+
-j4 -W
9390
- name: Parallel tests
9491
if: >-
9592
inputs.sanitizer == 'TSan'
9693
&& fromJSON(inputs.free-threading)
97-
run: ./python -m test --tsan-parallel --parallel-threads=4 -j4
94+
run: ./python -m test --tsan-parallel --parallel-threads=4 -j4 -W
9895
- name: Display logs
9996
if: always()
10097
run: find "${GITHUB_WORKSPACE}" -name 'san_log.*' | xargs head -n 1000

Doc/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,9 +88,9 @@ htmlhelp: build
8888
"build/htmlhelp/pydoc.hhp project file."
8989

9090
.PHONY: latex
91-
latex: _ensure-sphinxcontrib-svg2pdfconverter
9291
latex: BUILDER = latex
93-
latex: build
92+
latex: _ensure-sphinxcontrib-svg2pdfconverter
93+
$(MAKE) build BUILDER=$(BUILDER)
9494
@echo "Build finished; the LaTeX files are in build/latex."
9595
@echo "Run \`make all-pdf' or \`make all-ps' in that directory to" \
9696
"run these through (pdf)latex."

Doc/c-api/coro.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,3 +33,9 @@ return.
3333
with ``__name__`` and ``__qualname__`` set to *name* and *qualname*.
3434
A reference to *frame* is stolen by this function. The *frame* argument
3535
must not be ``NULL``.
36+
37+
.. deprecated-removed:: 3.16 3.18
38+
39+
This function has not been used since 3.10.
40+
It is also impossible to construct a proper *frame*
41+
object to call this function.

Doc/c-api/gen.rst

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,25 @@ than explicitly calling :c:func:`PyGen_New` or :c:func:`PyGen_NewWithQualName`.
3838
A reference to *frame* is stolen by this function. The argument must not be
3939
``NULL``.
4040
41+
.. deprecated-removed:: 3.16 3.18
42+
43+
This function has not been used since 3.10.
44+
It is also impossible to construct a proper *frame*
45+
object to call this function.
46+
4147
.. c:function:: PyObject* PyGen_NewWithQualName(PyFrameObject *frame, PyObject *name, PyObject *qualname)
4248
4349
Create and return a new generator object based on the *frame* object,
4450
with ``__name__`` and ``__qualname__`` set to *name* and *qualname*.
4551
A reference to *frame* is stolen by this function. The *frame* argument
4652
must not be ``NULL``.
4753
54+
.. deprecated-removed:: 3.16 3.18
55+
56+
This function has not been used since 3.10.
57+
It is also impossible to construct a proper *frame*
58+
object to call this function.
59+
4860
4961
.. c:function:: PyCodeObject* PyGen_GetCode(PyGenObject *gen)
5062
@@ -77,6 +89,12 @@ Asynchronous Generator Objects
7789
7890
.. versionadded:: 3.6
7991
92+
.. deprecated-removed:: 3.16 3.18
93+
94+
This function has not been used since 3.10.
95+
It is also impossible to construct a proper *frame*
96+
object to call this function.
97+
8098
.. c:function:: int PyAsyncGen_CheckExact(PyObject *op)
8199
82100
Return true if *op* is an asynchronous generator object, false otherwise.

Doc/c-api/memory.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ memory footprint as a whole. Consequently, under certain circumstances, the
7777
Python memory manager may or may not trigger appropriate actions, like garbage
7878
collection, memory compaction or other preventive procedures. Note that by using
7979
the C library allocator as shown in the previous example, the allocated memory
80-
for the I/O buffer escapes completely the Python memory manager.
80+
for the I/O buffer completely escapes the Python memory manager.
8181

8282
.. seealso::
8383

@@ -157,7 +157,7 @@ zero bytes.
157157
158158
.. c:function:: void* PyMem_RawCalloc(size_t nelem, size_t elsize)
159159
160-
Allocates *nelem* elements each whose size in bytes is *elsize* and returns
160+
Allocates *nelem* elements each of size *elsize* bytes and returns
161161
a pointer of type :c:expr:`void*` to the allocated memory, or ``NULL`` if the
162162
request fails. The memory is initialized to zeros.
163163
@@ -235,7 +235,7 @@ In the GIL-enabled build (default build) the
235235
236236
.. c:function:: void* PyMem_Calloc(size_t nelem, size_t elsize)
237237
238-
Allocates *nelem* elements each whose size in bytes is *elsize* and returns
238+
Allocates *nelem* elements each of size *elsize* bytes and returns
239239
a pointer of type :c:expr:`void*` to the allocated memory, or ``NULL`` if the
240240
request fails. The memory is initialized to zeros.
241241
@@ -368,7 +368,7 @@ The :ref:`default object allocator <default-memory-allocators>` uses the
368368
369369
.. c:function:: void* PyObject_Calloc(size_t nelem, size_t elsize)
370370
371-
Allocates *nelem* elements each whose size in bytes is *elsize* and returns
371+
Allocates *nelem* elements each of size *elsize* bytes and returns
372372
a pointer of type :c:expr:`void*` to the allocated memory, or ``NULL`` if the
373373
request fails. The memory is initialized to zeros.
374374

Doc/c-api/module.rst

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -247,6 +247,15 @@ Feature slots
247247
If ``Py_mod_multiple_interpreters`` is not specified, the import
248248
machinery defaults to ``Py_MOD_MULTIPLE_INTERPRETERS_SUPPORTED``.
249249
250+
For historical reasons, the values are declared as pointers (``void *``).
251+
When using :c:type:`PySlot` arrays, use :c:macro:`PySlot_DATA` for
252+
:c:macro:`!Py_mod_multiple_interpreters`:
253+
254+
.. code-block:: c
255+
256+
PySlot_DATA(Py_mod_multiple_interpreters,
257+
Py_MOD_PER_INTERPRETER_GIL_SUPPORTED)
258+
250259
.. versionadded:: 3.12
251260
252261
.. c:macro:: Py_mod_gil
@@ -272,6 +281,14 @@ Feature slots
272281
If ``Py_mod_gil`` is not specified, the import machinery defaults to
273282
``Py_MOD_GIL_USED``.
274283
284+
For historical reasons, the values are declared as pointers (``void *``).
285+
When using :c:type:`PySlot` arrays, use :c:macro:`PySlot_DATA` for
286+
:c:macro:`!Py_mod_gil`:
287+
288+
.. code-block:: c
289+
290+
PySlot_DATA(Py_mod_gil, Py_MOD_GIL_NOT_USED)
291+
275292
.. versionadded:: 3.13
276293
277294

Doc/c-api/weakref.rst

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,11 @@ as much as it can.
4343
should accept a single parameter, which will be the weak reference object
4444
itself. *callback* may also be ``None`` or ``NULL``. If *ob* is not a
4545
weakly referenceable object, or if *callback* is not callable, ``None``, or
46-
``NULL``, this will return ``NULL`` and raise :exc:`TypeError`.
46+
``NULL``, this will raise :exc:`TypeError` and return ``NULL``.
47+
48+
.. versionchanged:: next
49+
Raise :exc:`!TypeError` if *callback* is not callable, ``None``, or
50+
``NULL``.
4751
4852
.. seealso::
4953
:c:func:`PyType_SUPPORTS_WEAKREFS` for checking if *ob* is weakly
@@ -59,7 +63,11 @@ as much as it can.
5963
collected; it should accept a single parameter, which will be the weak
6064
reference object itself. *callback* may also be ``None`` or ``NULL``. If *ob*
6165
is not a weakly referenceable object, or if *callback* is not callable,
62-
``None``, or ``NULL``, this will return ``NULL`` and raise :exc:`TypeError`.
66+
``NULL``, this will raise :exc:`TypeError` and return ``NULL``.
67+
68+
.. versionchanged:: next
69+
Raise :exc:`!TypeError` if *callback* is not callable, ``None``, or
70+
``NULL``.
6371
6472
.. seealso::
6573
:c:func:`PyType_SUPPORTS_WEAKREFS` for checking if *ob* is weakly

Doc/deprecations/c-api-pending-removal-in-3.18.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,10 @@ Pending removal in Python 3.18
4040
* :c:func:`!_PyUnicodeWriter_PrepareKind`: (no replacement).
4141
* :c:func:`!_Py_HashPointer`: use :c:func:`Py_HashPointer`.
4242
* :c:func:`!_Py_fopen_obj`: use :c:func:`Py_fopen`.
43+
* :c:func:`PyGen_New`: (no replacement).
44+
* :c:func:`PyGen_NewWithQualName`: (no replacement).
45+
* :c:func:`PyCoro_New`: (no replacement).
46+
* :c:func:`PyAsyncGen_New`: (no replacement).
4347

4448
The `pythoncapi-compat project
4549
<https://github.com/python/pythoncapi-compat/>`__ can be used to get

Doc/howto/annotations.rst

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
Annotations Best Practices
55
**************************
66

7-
:author: Larry Hastings
8-
97
.. topic:: Abstract
108

119
This document is designed to encapsulate the best practices

Doc/howto/argparse.rst

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
Argparse Tutorial
55
*****************
66

7-
:author: Tshepang Mbambo
8-
97
.. currentmodule:: argparse
108

119
This tutorial is intended to be a gentle introduction to :mod:`argparse`, the

0 commit comments

Comments
 (0)