Skip to content

Commit a67af42

Browse files
authored
Merge branch '3.15' into backport-b12fcff-3.15
2 parents 2ab59ea + 4a599c0 commit a67af42

342 files changed

Lines changed: 14171 additions & 5488 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/jit.yml‎

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -87,24 +87,16 @@ jobs:
8787
./PCbuild/rt.bat ${{ matrix.debug && '-d' || '' }} -p ${{ matrix.architecture }} -q --multiprocess 0 --timeout 4500 --verbose2 --verbose3
8888
8989
macos:
90-
name: ${{ matrix.target }} (${{ matrix.debug && 'Debug' || 'Release' }})
90+
name: aarch64-apple-darwin/clang (${{ matrix.debug && 'Debug' || 'Release' }})
9191

92-
runs-on: ${{ matrix.runner }}
92+
runs-on: macos-26
9393
timeout-minutes: 60
9494
strategy:
9595
fail-fast: false
9696
matrix:
97-
target:
98-
- x86_64-apple-darwin/clang
99-
- aarch64-apple-darwin/clang
10097
debug:
10198
- true
10299
- false
103-
include:
104-
- target: x86_64-apple-darwin/clang
105-
runner: macos-26-intel
106-
- target: aarch64-apple-darwin/clang
107-
runner: macos-26
108100
steps:
109101
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
110102
with:

‎.github/workflows/tail-call.yml‎

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -24,17 +24,9 @@ env:
2424

2525
jobs:
2626
macos:
27-
name: ${{ matrix.target }}
28-
runs-on: ${{ matrix.runner }}
27+
name: aarch64-apple-darwin/clang
28+
runs-on: macos-26
2929
timeout-minutes: 60
30-
strategy:
31-
fail-fast: false
32-
matrix:
33-
include:
34-
- target: x86_64-apple-darwin/clang
35-
runner: macos-26-intel
36-
- target: aarch64-apple-darwin/clang
37-
runner: macos-26
3830
steps:
3931
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
4032
with:
@@ -49,7 +41,6 @@ jobs:
4941
- name: Build
5042
run: |
5143
export SDKROOT="$(xcrun --show-sdk-path)"
52-
export PATH="/usr/local/opt/llvm@${{ env.LLVM_VERSION }}/bin:$PATH"
5344
export PATH="/opt/homebrew/opt/llvm@${{ env.LLVM_VERSION }}/bin:$PATH"
5445
CC=clang-${{ env.LLVM_VERSION }} ./configure --with-tail-call-interp
5546
make all --jobs 4

‎.gitignore‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,3 +181,6 @@ Python/frozen_modules/MANIFEST
181181
# People's custom https://docs.anthropic.com/en/docs/claude-code/memory configs.
182182
/.claude/
183183
CLAUDE.local.md
184+
185+
# Local scratch space for things we or our agents do in our worktrees.
186+
/do-not-commit/

‎Doc/README.rst‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ tree but are maintained separately and are available from
2121
* `Sphinx <https://pypi.org/project/Sphinx/>`_
2222
* `blurb <https://pypi.org/project/blurb/>`_
2323
* `python-docs-theme <https://pypi.org/project/python-docs-theme/>`_
24+
* `sphinx-linklint <https://pypi.org/project/sphinx-linklint/>`_
2425

2526
The easiest way to install these tools is to create a virtual environment and
2627
install the tools into there.
@@ -57,6 +58,8 @@ Available make targets are:
5758
* "venv", which creates a virtual environment with all necessary tools
5859
installed.
5960

61+
* "lock", which regenerates the pinned dependencies in ``pylock.toml``.
62+
6063
* "html", which builds standalone HTML files for offline viewing.
6164

6265
* "htmlview", which re-uses the "html" builder, but then opens the main page
@@ -79,6 +82,9 @@ Available make targets are:
7982

8083
* "text", which builds a plain text file for each source file.
8184

85+
* "texinfo", which builds Texinfo source files as input to ``makeinfo`` to
86+
produce Info documents.
87+
8288
* "epub", which builds an EPUB document, suitable to be viewed on e-book
8389
readers.
8490

@@ -97,6 +103,10 @@ Available make targets are:
97103
plain text documentation for the labels defined in
98104
``tools/pyspecific.py`` -- pydoc needs these to show topic and keyword help.
99105

106+
* "doctest", which runs doctests in the documentation.
107+
108+
* "gettext", which generates gettext message catalog templates.
109+
100110
* "check", which checks for frequent markup errors.
101111

102112
* "dist", (Unix only) which creates distributable archives of HTML, text,

‎Doc/builtins/functions.rst‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -314,6 +314,10 @@ are always available. They are listed here in alphabetical order.
314314
consists of a single expression, or ``'single'`` if it consists of a single
315315
interactive statement (in the latter case, expression statements that
316316
evaluate to something other than ``None`` will be printed).
317+
It can also be ``'func_type'`` if *source* consists of a
318+
function type signature, for example ``(int) -> str``; see
319+
:func:`ast.parse` for more information. This mode requires passing
320+
:data:`ast.PyCF_ONLY_AST` in *flags*.
317321

318322
The optional arguments *flags* and *dont_inherit* control which
319323
:ref:`compiler options <ast-compiler-flags>` should be activated
@@ -387,6 +391,9 @@ are always available. They are listed here in alphabetical order.
387391
``ast.PyCF_ALLOW_TOP_LEVEL_AWAIT`` can now be passed in flags to enable
388392
support for top-level ``await``, ``async for``, and ``async with``.
389393

394+
.. versionchanged:: 3.8
395+
Added support for ``mode='func_type'``.
396+
390397
.. versionchanged:: 3.12
391398
:exc:`SyntaxError` is raised instead of :exc:`ValueError` when null bytes
392399
are encountered in *source*.

‎Doc/c-api/buffer.rst‎

Lines changed: 144 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -284,19 +284,38 @@ The flags that control the logical structure of the memory are listed
284284
in decreasing order of complexity. Note that each flag contains all bits
285285
of the flags below it.
286286

287-
.. tabularcolumns:: |p{0.35\linewidth}|l|l|l|
288-
289-
+-----------------------------+-------+---------+------------+
290-
| Request | shape | strides | suboffsets |
291-
+=============================+=======+=========+============+
292-
| .. c:macro:: PyBUF_INDIRECT | yes | yes | if needed |
293-
+-----------------------------+-------+---------+------------+
294-
| .. c:macro:: PyBUF_STRIDES | yes | yes | NULL |
295-
+-----------------------------+-------+---------+------------+
296-
| .. c:macro:: PyBUF_ND | yes | NULL | NULL |
297-
+-----------------------------+-------+---------+------------+
298-
| .. c:macro:: PyBUF_SIMPLE | NULL | NULL | NULL |
299-
+-----------------------------+-------+---------+------------+
287+
.. stable-abi-note::
288+
289+
These values are available when compiling for the
290+
:ref:`Stable ABI <stable>` since version 3.11.
291+
292+
.. omit-stable-abi-notes::
293+
294+
.. list-table::
295+
:align: left
296+
:widths: auto
297+
:header-rows: 1
298+
299+
* - Request
300+
- shape
301+
- strides
302+
- suboffsets
303+
* - .. c:macro:: PyBUF_INDIRECT
304+
- yes
305+
- yes
306+
- if needed
307+
* - .. c:macro:: PyBUF_STRIDES
308+
- yes
309+
- yes
310+
- NULL
311+
* - .. c:macro:: PyBUF_ND
312+
- yes
313+
- NULL
314+
- NULL
315+
* - .. c:macro:: PyBUF_SIMPLE
316+
- NULL
317+
- NULL
318+
- NULL
300319

301320

302321
.. index:: contiguous, C-contiguous, Fortran contiguous
@@ -308,19 +327,43 @@ C or Fortran :term:`contiguity <contiguous>` can be explicitly requested,
308327
with and without stride information. Without stride information, the buffer
309328
must be C-contiguous.
310329

311-
.. tabularcolumns:: |p{0.35\linewidth}|l|l|l|l|
312-
313-
+-----------------------------------+-------+---------+------------+--------+
314-
| Request | shape | strides | suboffsets | contig |
315-
+===================================+=======+=========+============+========+
316-
| .. c:macro:: PyBUF_C_CONTIGUOUS | yes | yes | NULL | C |
317-
+-----------------------------------+-------+---------+------------+--------+
318-
| .. c:macro:: PyBUF_F_CONTIGUOUS | yes | yes | NULL | F |
319-
+-----------------------------------+-------+---------+------------+--------+
320-
| .. c:macro:: PyBUF_ANY_CONTIGUOUS | yes | yes | NULL | C or F |
321-
+-----------------------------------+-------+---------+------------+--------+
322-
| :c:macro:`PyBUF_ND` | yes | NULL | NULL | C |
323-
+-----------------------------------+-------+---------+------------+--------+
330+
.. stable-abi-note::
331+
332+
These values are available when compiling for the
333+
:ref:`Stable ABI <stable>` since version 3.11.
334+
335+
.. omit-stable-abi-notes::
336+
337+
.. list-table::
338+
:align: left
339+
:widths: auto
340+
:header-rows: 1
341+
342+
* - Request
343+
- shape
344+
- strides
345+
- suboffsets
346+
- contig
347+
* - .. c:macro:: PyBUF_C_CONTIGUOUS
348+
- yes
349+
- yes
350+
- NULL
351+
- C
352+
* - .. c:macro:: PyBUF_F_CONTIGUOUS
353+
- yes
354+
- yes
355+
- NULL
356+
- F
357+
* - .. c:macro:: PyBUF_ANY_CONTIGUOUS
358+
- yes
359+
- yes
360+
- NULL
361+
- C or F
362+
* - :c:macro:`PyBUF_ND`
363+
- yes
364+
- NULL
365+
- NULL
366+
- C
324367

325368

326369
compound requests
@@ -333,27 +376,81 @@ used combinations as single flags.
333376
In the following table *U* stands for undefined contiguity. The consumer would
334377
have to call :c:func:`PyBuffer_IsContiguous` to determine contiguity.
335378

336-
.. tabularcolumns:: |p{0.35\linewidth}|l|l|l|l|l|l|
337-
338-
+-------------------------------+-------+---------+------------+--------+----------+--------+
339-
| Request | shape | strides | suboffsets | contig | readonly | format |
340-
+===============================+=======+=========+============+========+==========+========+
341-
| .. c:macro:: PyBUF_FULL | yes | yes | if needed | U | 0 | yes |
342-
+-------------------------------+-------+---------+------------+--------+----------+--------+
343-
| .. c:macro:: PyBUF_FULL_RO | yes | yes | if needed | U | 1 or 0 | yes |
344-
+-------------------------------+-------+---------+------------+--------+----------+--------+
345-
| .. c:macro:: PyBUF_RECORDS | yes | yes | NULL | U | 0 | yes |
346-
+-------------------------------+-------+---------+------------+--------+----------+--------+
347-
| .. c:macro:: PyBUF_RECORDS_RO | yes | yes | NULL | U | 1 or 0 | yes |
348-
+-------------------------------+-------+---------+------------+--------+----------+--------+
349-
| .. c:macro:: PyBUF_STRIDED | yes | yes | NULL | U | 0 | NULL |
350-
+-------------------------------+-------+---------+------------+--------+----------+--------+
351-
| .. c:macro:: PyBUF_STRIDED_RO | yes | yes | NULL | U | 1 or 0 | NULL |
352-
+-------------------------------+-------+---------+------------+--------+----------+--------+
353-
| .. c:macro:: PyBUF_CONTIG | yes | NULL | NULL | C | 0 | NULL |
354-
+-------------------------------+-------+---------+------------+--------+----------+--------+
355-
| .. c:macro:: PyBUF_CONTIG_RO | yes | NULL | NULL | C | 1 or 0 | NULL |
356-
+-------------------------------+-------+---------+------------+--------+----------+--------+
379+
.. stable-abi-note::
380+
381+
These values are available when compiling for the
382+
:ref:`Stable ABI <stable>` since version 3.11.
383+
384+
.. omit-stable-abi-notes::
385+
386+
.. list-table::
387+
:align: left
388+
:widths: auto
389+
:header-rows: 1
390+
391+
* - Request
392+
- shape
393+
- strides
394+
- suboffsets
395+
- contig
396+
- readonly
397+
- format
398+
* - .. c:macro:: PyBUF_FULL
399+
- yes
400+
- yes
401+
- if needed
402+
- U
403+
- 0
404+
- yes
405+
* - .. c:macro:: PyBUF_FULL_RO
406+
- yes
407+
- yes
408+
- if needed
409+
- U
410+
- 1 or 0
411+
- yes
412+
* - .. c:macro:: PyBUF_RECORDS
413+
- yes
414+
- yes
415+
- NULL
416+
- U
417+
- 0
418+
- yes
419+
* - .. c:macro:: PyBUF_RECORDS_RO
420+
- yes
421+
- yes
422+
- NULL
423+
- U
424+
- 1 or 0
425+
- yes
426+
* - .. c:macro:: PyBUF_STRIDED
427+
- yes
428+
- yes
429+
- NULL
430+
- U
431+
- 0
432+
- NULL
433+
* - .. c:macro:: PyBUF_STRIDED_RO
434+
- yes
435+
- yes
436+
- NULL
437+
- U
438+
- 1 or 0
439+
- NULL
440+
* - .. c:macro:: PyBUF_CONTIG
441+
- yes
442+
- NULL
443+
- NULL
444+
- C
445+
- 0
446+
- NULL
447+
* - .. c:macro:: PyBUF_CONTIG_RO
448+
- yes
449+
- NULL
450+
- NULL
451+
- C
452+
- 1 or 0
453+
- NULL
357454

358455

359456
Complex arrays

‎Doc/c-api/bytes.rst‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -488,7 +488,7 @@ Variant using a pointer to compute the final size::
488488
489489
char *str = PyBytesWriter_GetData(writer);
490490
memcpy(str, "abc", 3);
491-
str += 1;
491+
str += 3;
492492
return PyBytesWriter_FinishWithPointer(writer, str);
493493
}
494494
@@ -537,7 +537,7 @@ Update ``_PyBytes_Resize()`` code
537537
538538
Example of code using the soft deprecated ``_PyBytes_Resize()`` API::
539539
540-
void create_string(Py_ssize_t size)
540+
PyObject* create_string(Py_ssize_t size)
541541
{
542542
PyObject *bytes = PyBytes_FromStringAndSize(NULL, size);
543543
if (bytes == NULL) {
@@ -555,7 +555,7 @@ Example of code using the soft deprecated ``_PyBytes_Resize()`` API::
555555
556556
It can now be updated to::
557557
558-
void create_string(Py_ssize_t size)
558+
PyObject* create_string(Py_ssize_t size)
559559
{
560560
PyBytesWriter *writer = PyBytesWriter_Create(size);
561561
if (writer == NULL) {

‎Doc/c-api/call.rst‎

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -81,17 +81,17 @@ This is a pointer to a function with the following signature:
8181
8282
- *callable* is the object being called.
8383
- *args* is a C array consisting of the positional arguments followed by the
84-
values of the keyword arguments.
85-
This can be *NULL* if there are no arguments.
84+
values of the keyword arguments.
85+
This can be *NULL* if there are no arguments.
8686
- *nargsf* is the number of positional arguments plus possibly the
87-
:c:macro:`PY_VECTORCALL_ARGUMENTS_OFFSET` flag.
88-
To get the actual number of positional arguments from *nargsf*,
89-
use :c:func:`PyVectorcall_NARGS`.
87+
:c:macro:`PY_VECTORCALL_ARGUMENTS_OFFSET` flag.
88+
To get the actual number of positional arguments from *nargsf*,
89+
use :c:func:`PyVectorcall_NARGS`.
9090
- *kwnames* is a tuple containing the names of the keyword arguments;
91-
in other words, the keys of the kwargs dict.
92-
These names must be strings (instances of ``str`` or a subclass)
93-
and they must be unique.
94-
If there are no keyword arguments, then *kwnames* can instead be *NULL*.
91+
in other words, the keys of the kwargs dict.
92+
These names must be strings (instances of ``str`` or a subclass)
93+
and they must be unique.
94+
If there are no keyword arguments, then *kwnames* can instead be *NULL*.
9595

9696
.. c:macro:: PY_VECTORCALL_ARGUMENTS_OFFSET
9797

0 commit comments

Comments
 (0)