Skip to content

Commit 5dc25db

Browse files
committed
Merge main
2 parents 09cdce6 + ac8ba0c commit 5dc25db

63 files changed

Lines changed: 1224 additions & 585 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/CODEOWNERS

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -170,9 +170,6 @@ Mac/ @python/macos-team
170170
Lib/_osx_support.py @python/macos-team
171171
Lib/test/test__osx_support.py @python/macos-team
172172

173-
# WebAssembly
174-
Tools/wasm/README.md @brettcannon @freakboy3742 @emmatyping
175-
176173
# WebAssembly (Emscripten)
177174
Platforms/emscripten @freakboy3742 @emmatyping
178175
Tools/wasm/emscripten @freakboy3742 @emmatyping
@@ -334,7 +331,6 @@ Modules/_remote_debugging/ @pablogsal
334331

335332
# Sub-Interpreters
336333
**/*crossinterp* @ericsnowcurrently
337-
**/*interpreteridobject.* @ericsnowcurrently
338334
Doc/library/concurrent.interpreters.rst @ericsnowcurrently
339335
Lib/concurrent/futures/interpreter.py @ericsnowcurrently
340336
Lib/concurrent/interpreters/ @ericsnowcurrently
@@ -645,3 +641,6 @@ Modules/**/clinic/
645641
Objects/**/clinic/
646642
PC/**/clinic/
647643
Python/**/clinic/
644+
645+
# Exclude HTML IDs list
646+
Doc/tools/removed-ids.txt

.github/workflows/reusable-san.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ jobs:
5555
SAN_LOG_OPTION: log_path=${{ github.workspace }}/san_log
5656
SUPPRESSIONS_SUFFIX: >-
5757
${{
58-
fromJSON(inputs.free-threading)
58+
inputs.free-threading
5959
&& '_free_threading'
6060
|| ''
6161
}}
@@ -101,7 +101,7 @@ jobs:
101101
}}
102102
--with-pydebug
103103
${{ inputs.sanitizer == 'TSan' && '--with-openssl="$OPENSSL_DIR" --with-openssl-rpath=auto' || '' }}
104-
${{ fromJSON(inputs.free-threading) && '--disable-gil' || '' }}
104+
${{ inputs.free-threading && '--disable-gil' || '' }}
105105
- name: Build CPython
106106
run: make -j4
107107
- name: Display build info
@@ -114,7 +114,7 @@ jobs:
114114
- name: Parallel tests
115115
if: >-
116116
inputs.sanitizer == 'TSan'
117-
&& fromJSON(inputs.free-threading)
117+
&& inputs.free-threading
118118
run: ./python -m test --tsan-parallel --parallel-threads=4 -j4 -W --timeout=600 --slowest
119119
- name: Display logs
120120
if: always()
@@ -125,7 +125,7 @@ jobs:
125125
with:
126126
name: >-
127127
${{ inputs.sanitizer }}-logs-${{
128-
fromJSON(inputs.free-threading)
128+
inputs.free-threading
129129
&& 'free-threading'
130130
|| 'default'
131131
}}

.github/workflows/reusable-ubuntu.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ jobs:
5858
- name: Install dependencies
5959
run: sudo ./.github/workflows/posix-deps-apt.sh
6060
- name: Install Clang and BOLT
61-
if: fromJSON(inputs.bolt-optimizations)
61+
if: inputs.bolt-optimizations
6262
run: |
6363
# On ubuntu-26.04 image, LLVM is LLVM-21 by default
6464
sudo apt-get install --no-install-recommends bolt-21
@@ -99,9 +99,9 @@ jobs:
9999
--enable-slower-safety
100100
--enable-safety
101101
--with-openssl="$OPENSSL_DIR"
102-
${{ fromJSON(inputs.free-threading) && '--disable-gil' || '' }}
103-
${{ fromJSON(inputs.bolt-optimizations) && '--enable-bolt' || '' }}
104-
${{ fromJSON(inputs.upload-install-hashes) && '--prefix=/usr --libdir=/usr/lib/$(gcc --print-multiarch) --with-build-details-suffix' || '' }}
102+
${{ inputs.free-threading && '--disable-gil' || '' }}
103+
${{ inputs.bolt-optimizations && '--enable-bolt' || '' }}
104+
${{ inputs.upload-install-hashes && '--prefix=/usr --libdir=/usr/lib/$(gcc --print-multiarch) --with-build-details-suffix' || '' }}
105105
- name: Build CPython out-of-tree
106106
if: inputs.free-threading
107107
working-directory: ${{ env.CPYTHON_BUILDDIR }}

.github/workflows/reusable-windows.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ jobs:
4545
-e -v
4646
${{ inputs.interpreter == 'switch-case' && '-d' || '--tail-call-interp -c Release' }}
4747
-p "${ARCH}"
48-
${{ fromJSON(inputs.free-threading) && '--disable-gil' || '' }}
48+
${{ inputs.free-threading && '--disable-gil' || '' }}
4949
shell: bash
5050
- name: Display build info
5151
run: .\\python.bat -m test.pythoninfo
@@ -55,5 +55,5 @@ jobs:
5555
-p "${ARCH}"
5656
-q --fast-ci
5757
${{ inputs.interpreter == 'switch-case' && '-d' || '' }}
58-
${{ fromJSON(inputs.free-threading) && '--disable-gil' || '' }}
58+
${{ inputs.free-threading && '--disable-gil' || '' }}
5959
shell: bash

Doc/c-api/exceptions.rst

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,21 @@ Printing and clearing
119119
.. versionadded:: 3.12
120120
121121
122+
.. c:function:: void PyErr_Display(PyObject *unused, PyObject *value, PyObject *tb)
123+
124+
Legacy variant of :c:func:`PyErr_DisplayException`.
125+
126+
Print the exception *value* with its traceback to :data:`sys.stderr`.
127+
If *value* has no traceback set, *tb* is used as its traceback.
128+
The first argument is ignored.
129+
130+
If :data:`sys.stderr` is ``None``, nothing is printed.
131+
If :data:`sys.stderr` is not set, the exception is dumped to the
132+
C ``stderr`` stream instead.
133+
134+
.. deprecated:: 3.12
135+
Use :c:func:`PyErr_DisplayException` instead.
136+
122137
Raising exceptions
123138
==================
124139

Doc/c-api/init_config.rst

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1235,9 +1235,9 @@ PyConfig
12351235
12361236
.. c:member:: wchar_t* base_executable
12371237
1238-
Python base executable: :data:`sys._base_executable`.
1238+
Python base executable: ``sys._base_executable``.
12391239
1240-
Set by the :envvar:`__PYVENV_LAUNCHER__` environment variable.
1240+
Set by the ``__PYVENV_LAUNCHER__`` environment variable.
12411241
12421242
Set from :c:member:`PyConfig.executable` if ``NULL``.
12431243
@@ -1748,7 +1748,7 @@ PyConfig
17481748
17491749
* On macOS, use :envvar:`PYTHONEXECUTABLE` environment variable if set.
17501750
* If the ``WITH_NEXT_FRAMEWORK`` macro is defined, use
1751-
:envvar:`__PYVENV_LAUNCHER__` environment variable if set.
1751+
``__PYVENV_LAUNCHER__`` environment variable if set.
17521752
* Use ``argv[0]`` of :c:member:`~PyConfig.argv` if available and
17531753
non-empty.
17541754
* Otherwise, use ``L"python"`` on Windows, or ``L"python3"`` on other
@@ -1984,8 +1984,7 @@ PyConfig
19841984
19851985
The :mod:`warnings` module adds :data:`sys.warnoptions` in the reverse
19861986
order: the last :c:member:`PyConfig.warnoptions` item becomes the first
1987-
item of :data:`warnings.filters` which is checked first (highest
1988-
priority).
1987+
item of ``warnings.filters`` which is checked first (highest priority).
19891988
19901989
The :option:`-W` command line options adds its value to
19911990
:c:member:`~PyConfig.warnoptions`, it can be used multiple times.

Doc/c-api/intro.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1163,7 +1163,7 @@ when defined by the compiler, will also implicitly enable :c:macro:`!Py_DEBUG`.
11631163
In addition to the reference count debugging described below, extra checks are
11641164
performed. See :ref:`Python Debug Build <debug-build>` for more details.
11651165

1166-
Defining :c:macro:`Py_TRACE_REFS` enables reference tracing
1166+
Defining ``Py_TRACE_REFS`` enables reference tracing
11671167
(see the :option:`configure --with-trace-refs option <--with-trace-refs>`).
11681168
When defined, a circular doubly linked list of active objects is maintained by adding two extra
11691169
fields to every :c:type:`PyObject`. Total allocations are tracked as well. Upon

Doc/library/asyncio-task.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -433,6 +433,10 @@ unless it is :exc:`asyncio.CancelledError`,
433433
is also included in the exception group.
434434
The same special case is made for
435435
:exc:`KeyboardInterrupt` and :exc:`SystemExit` as in the previous paragraph.
436+
There is an additional special case made only for the body of the
437+
``async with``: if it raises :exc:`GeneratorExit` and none of the
438+
other tasks raise exceptions that would be reported, then the
439+
:exc:`GeneratorExit` is reraised.
436440

437441
Task groups are careful not to mix up the internal cancellation used to
438442
"wake up" their :meth:`~object.__aexit__` with cancellation requests
@@ -456,6 +460,10 @@ reported by :meth:`asyncio.Task.cancelling`.
456460
Improved handling of simultaneous internal and external cancellations
457461
and correct preservation of cancellation counts.
458462

463+
.. versionchanged:: 3.15
464+
465+
Addition of the special case for :exc:`GeneratorExit`.
466+
459467
Sleeping
460468
========
461469

Doc/library/collections.rst

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,15 @@ For example::
268268
>>> c['sausage'] = 0 # counter entry with a zero count
269269
>>> del c['sausage'] # del actually removes the entry
270270

271+
Counters maintain insertion order internally but display from most common to
272+
least common when possible:
273+
274+
>>> c = Counter(a=1, b=2, c=3)
275+
>>> c # display most common to least
276+
Counter({'c': 3, 'b': 2, 'a': 1})
277+
>>> list(c.items()) # original insertion order
278+
[('a', 1), ('b', 2), ('c', 3)]
279+
271280
.. versionadded:: 3.1
272281

273282
.. versionchanged:: 3.7 As a :class:`dict` subclass, :class:`Counter`

Doc/library/multiprocessing.rst

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2536,7 +2536,7 @@ with the :class:`Pool` class.
25362536
Callbacks should complete immediately since otherwise the thread which
25372537
handles the results will get blocked.
25382538

2539-
.. method:: imap(func, iterable[, chunksize])
2539+
.. method:: imap(func, iterable, chunksize=1, *, buffersize=None)
25402540

25412541
A lazier version of :meth:`.map`.
25422542

@@ -2550,12 +2550,27 @@ with the :class:`Pool` class.
25502550
``next(timeout)`` will raise :exc:`multiprocessing.TimeoutError` if the
25512551
result cannot be returned within *timeout* seconds.
25522552

2553-
.. method:: imap_unordered(func, iterable[, chunksize])
2553+
The *iterable* is collected immediately rather than lazily, unless a
2554+
*buffersize* is specified to limit the number of submitted tasks whose
2555+
results have not yet been yielded. If the buffer is full, iteration over
2556+
the *iterables* pauses until a result is yielded from the buffer.
2557+
To fully utilize pool's capacity when using this feature,
2558+
set *buffersize* at least to the number of processes in pool
2559+
(to consume *iterable* as you go), or even higher
2560+
(to prefetch the next ``N=buffersize-processes`` arguments).
2561+
2562+
.. versionchanged:: next
2563+
Added the *buffersize* parameter.
2564+
2565+
.. method:: imap_unordered(func, iterable, chunksize=1, *, buffersize=None)
25542566

25552567
The same as :meth:`imap` except that the ordering of the results from the
25562568
returned iterator should be considered arbitrary. (Only when there is
25572569
only one worker process is the order guaranteed to be "correct".)
25582570

2571+
.. versionchanged:: next
2572+
Added the *buffersize* parameter.
2573+
25592574
.. method:: starmap(func, iterable[, chunksize])
25602575

25612576
Like :meth:`~multiprocessing.pool.Pool.map` except that the

0 commit comments

Comments
 (0)