Skip to content

Commit 1c59358

Browse files
committed
Merge remote-tracking branch 'origin/main' into specialize-enable-deferred
2 parents 04826f7 + be3c131 commit 1c59358

File tree

347 files changed

+10223
-6783
lines changed

Some content is hidden

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

347 files changed

+10223
-6783
lines changed

.github/CODEOWNERS

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -289,10 +289,10 @@ Tools/jit/ @brandtbucher @savannahostrowski @diegorusso
289289
InternalDocs/jit.md @brandtbucher @savannahostrowski @diegorusso @AA-Turner
290290

291291
# Micro-op / μop / Tier 2 Optimiser
292-
Python/optimizer.c @markshannon
292+
Python/optimizer.c @markshannon @Fidget-Spinner
293293
Python/optimizer_analysis.c @markshannon @tomasr8 @Fidget-Spinner
294294
Python/optimizer_bytecodes.c @markshannon @tomasr8 @Fidget-Spinner
295-
Python/optimizer_symbols.c @markshannon @tomasr8
295+
Python/optimizer_symbols.c @markshannon @tomasr8 @Fidget-Spinner
296296

297297
# Parser, Lexer, and Grammar
298298
Grammar/python.gram @pablogsal @lysnikolaou

.github/workflows/mypy.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ on:
2626
- "Tools/build/update_file.py"
2727
- "Tools/build/verify_ensurepip_wheels.py"
2828
- "Tools/cases_generator/**"
29+
- "Tools/check-c-api-docs/**"
2930
- "Tools/clinic/**"
3031
- "Tools/jit/**"
3132
- "Tools/peg_generator/**"
@@ -58,6 +59,7 @@ jobs:
5859
"Lib/tomllib",
5960
"Tools/build",
6061
"Tools/cases_generator",
62+
"Tools/check-c-api-docs",
6163
"Tools/clinic",
6264
"Tools/jit",
6365
"Tools/peg_generator",

.github/workflows/tail-call.yml

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -79,19 +79,17 @@ jobs:
7979
with:
8080
python-version: '3.11'
8181

82-
- name: Native Windows (debug)
82+
- name: Native Windows MSVC (release)
8383
if: runner.os == 'Windows' && matrix.architecture != 'ARM64'
8484
shell: cmd
8585
run: |
86-
choco install llvm --allow-downgrade --no-progress --version ${{ matrix.llvm }}.1.0
87-
set PlatformToolset=clangcl
88-
set LLVMToolsVersion=${{ matrix.llvm }}.1.0
89-
set LLVMInstallDir=C:\Program Files\LLVM
90-
call ./PCbuild/build.bat --tail-call-interp -d -p ${{ matrix.architecture }}
91-
call ./PCbuild/rt.bat -d -p ${{ matrix.architecture }} -q --multiprocess 0 --timeout 4500 --verbose2 --verbose3
86+
choco install visualstudio2026buildtools --no-progress -y --force --params "--add Microsoft.VisualStudio.Component.VC.Tools.x86.x64 --locale en-US --passive"
87+
$env:PATH = "C:\Program Files (x86)\Microsoft Visual Studio\18\BuildTools\MSBuild\Current\bin;$env:PATH"
88+
./PCbuild/build.bat --tail-call-interp -c Release -p ${{ matrix.architecture }} "/p:PlatformToolset=v145"
89+
./PCbuild/rt.bat -p ${{ matrix.architecture }} -q --multiprocess 0 --timeout 4500 --verbose2 --verbose3
9290
9391
# No tests (yet):
94-
- name: Emulated Windows (release)
92+
- name: Emulated Windows Clang (release)
9593
if: runner.os == 'Windows' && matrix.architecture == 'ARM64'
9694
shell: cmd
9795
run: |

Doc/c-api/extension-modules.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ and must be named after the module name plus an extension listed in
2929
Extension export hook
3030
.....................
3131

32-
.. versionadded:: next
32+
.. versionadded:: 3.15
3333

3434
Support for the :samp:`PyModExport_{<name>}` export hook was added in Python
3535
3.15. The older way of defining modules is still available: consult either
@@ -191,7 +191,7 @@ the :c:data:`Py_mod_multiple_interpreters` slot.
191191
``PyInit`` function
192192
...................
193193

194-
.. deprecated:: next
194+
.. deprecated:: 3.15
195195

196196
This functionality is :term:`soft deprecated`.
197197
It will not get new features, but there are no plans to remove it.
@@ -272,7 +272,7 @@ For example, a module called ``spam`` would be defined like this::
272272
Legacy single-phase initialization
273273
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
274274
275-
.. deprecated:: next
275+
.. deprecated:: 3.15
276276
277277
Single-phase initialization is :term:`soft deprecated`.
278278
It is a legacy mechanism to initialize extension

Doc/c-api/intro.rst

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,46 @@ header files properly declare the entry points to be ``extern "C"``. As a result
107107
there is no need to do anything special to use the API from C++.
108108

109109

110+
.. _capi-system-includes:
111+
112+
System includes
113+
---------------
114+
115+
:file:`Python.h` includes several standard header files.
116+
C extensions should include the standard headers that they use,
117+
and should not rely on these implicit includes.
118+
The implicit includes are:
119+
120+
* ``<assert.h>``
121+
* ``<intrin.h>`` (on Windows)
122+
* ``<inttypes.h>``
123+
* ``<limits.h>``
124+
* ``<math.h>``
125+
* ``<stdarg.h>``
126+
* ``<wchar.h>``
127+
* ``<sys/types.h>`` (if present)
128+
129+
The following are included for backwards compatibility, unless using
130+
:ref:`Limited API <limited-c-api>` 3.13 or newer:
131+
132+
* ``<ctype.h>``
133+
* ``<unistd.h>`` (on POSIX)
134+
135+
The following are included for backwards compatibility, unless using
136+
:ref:`Limited API <limited-c-api>` 3.11 or newer:
137+
138+
* ``<errno.h>``
139+
* ``<stdio.h>``
140+
* ``<stdlib.h>``
141+
* ``<string.h>``
142+
143+
.. note::
144+
145+
Since Python may define some pre-processor definitions which affect the standard
146+
headers on some systems, you *must* include :file:`Python.h` before any standard
147+
headers are included.
148+
149+
110150
Useful macros
111151
=============
112152

Doc/c-api/module.rst

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ Modules created using the C API are typically defined using an
142142
array of :dfn:`slots`.
143143
The slots provide a "description" of how a module should be created.
144144
145-
.. versionchanged:: next
145+
.. versionchanged:: 3.15
146146
147147
Previously, a :c:type:`PyModuleDef` struct was necessary to define modules.
148148
The older way of defining modules is still available: consult either the
@@ -190,7 +190,7 @@ Metadata slots
190190
However, it is still recommended to include this slot for introspection
191191
and debugging purposes.
192192
193-
.. versionadded:: next
193+
.. versionadded:: 3.15
194194
195195
Use :c:member:`PyModuleDef.m_name` instead to support previous versions.
196196
@@ -201,7 +201,7 @@ Metadata slots
201201
202202
Usually it is set to a variable created with :c:macro:`PyDoc_STRVAR`.
203203
204-
.. versionadded:: next
204+
.. versionadded:: 3.15
205205
206206
Use :c:member:`PyModuleDef.m_doc` instead to support previous versions.
207207
@@ -332,7 +332,7 @@ Creation and initialization slots
332332
333333
.. versionadded:: 3.5
334334
335-
.. versionchanged:: next
335+
.. versionchanged:: 3.15
336336
337337
The *slots* argument may be a ``ModuleSpec``-like object, rather than
338338
a true :py:class:`~importlib.machinery.ModuleSpec` instance.
@@ -365,7 +365,7 @@ Creation and initialization slots
365365
366366
.. versionadded:: 3.5
367367
368-
.. versionchanged:: next
368+
.. versionchanged:: 3.15
369369
370370
Repeated ``Py_mod_exec`` slots are disallowed, except in
371371
:c:type:`PyModuleDef.m_slots`.
@@ -384,7 +384,7 @@ Creation and initialization slots
384384
The table must be statically allocated (or otherwise guaranteed to outlive
385385
the module object).
386386
387-
.. versionadded:: next
387+
.. versionadded:: 3.15
388388
389389
Use :c:member:`PyModuleDef.m_methods` instead to support previous versions.
390390
@@ -434,7 +434,7 @@ To retrieve the state from a given module, use the following functions:
434434
435435
On error, set *\*result* to -1, and return -1 with an exception set.
436436
437-
.. versionadded:: next
437+
.. versionadded:: 3.15
438438
439439
440440
@@ -459,7 +459,7 @@ defining the module state.
459459
460460
Use :c:func:`PyModule_GetStateSize` to retrieve the size of a given module.
461461
462-
.. versionadded:: next
462+
.. versionadded:: 3.15
463463
464464
Use :c:member:`PyModuleDef.m_size` instead to support previous versions.
465465
@@ -482,7 +482,7 @@ defining the module state.
482482
(:c:data:`Py_mod_state_size`) is greater than 0 and the module state
483483
(as returned by :c:func:`PyModule_GetState`) is ``NULL``.
484484
485-
.. versionadded:: next
485+
.. versionadded:: 3.15
486486
487487
Use :c:member:`PyModuleDef.m_size` instead to support previous versions.
488488
@@ -510,7 +510,7 @@ defining the module state.
510510
the cyclic garbage collector is not involved and
511511
the :c:macro:`Py_mod_state_free` function is called directly.
512512
513-
.. versionadded:: next
513+
.. versionadded:: 3.15
514514
515515
Use :c:member:`PyModuleDef.m_clear` instead to support previous versions.
516516
@@ -532,7 +532,7 @@ defining the module state.
532532
(:c:data:`Py_mod_state_size`) is greater than 0 and the module state
533533
(as returned by :c:func:`PyModule_GetState`) is ``NULL``.
534534
535-
.. versionadded:: next
535+
.. versionadded:: 3.15
536536
537537
Use :c:member:`PyModuleDef.m_free` instead to support previous versions.
538538
@@ -593,15 +593,15 @@ A module's token -- and the *your_token* value to use in the above code -- is:
593593
This means that :c:macro:`!Py_mod_token` cannot be used in
594594
:c:member:`PyModuleDef.m_slots`.
595595
596-
.. versionadded:: next
596+
.. versionadded:: 3.15
597597
598598
.. c:function:: int PyModule_GetToken(PyObject *module, void** result)
599599
600600
Set *\*result* to the module's token and return 0.
601601
602602
On error, set *\*result* to NULL, and return -1 with an exception set.
603603
604-
.. versionadded:: next
604+
.. versionadded:: 3.15
605605
606606
See also :c:func:`PyType_GetModuleByToken`.
607607
@@ -641,7 +641,7 @@ rather than from an extension's :ref:`export hook <extension-export-hook>`.
641641
:c:func:`!PyModule_FromSlotsAndSpec` call.
642642
In particular, it may be heap-allocated.
643643
644-
.. versionadded:: next
644+
.. versionadded:: 3.15
645645
646646
.. c:function:: int PyModule_Exec(PyObject *module)
647647
@@ -654,7 +654,7 @@ rather than from an extension's :ref:`export hook <extension-export-hook>`.
654654
:ref:`legacy single-phase initialization <single-phase-initialization>`,
655655
this function does nothing and returns 0.
656656
657-
.. versionadded:: next
657+
.. versionadded:: 3.15
658658
659659
660660

Doc/c-api/object.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ Object Protocol
111111
object type name: str
112112
object repr : 'abcdef'
113113
114-
.. versionadded:: next
114+
.. versionadded:: 3.15
115115
116116
117117
.. c:function:: int PyObject_HasAttrWithError(PyObject *o, PyObject *attr_name)

Doc/c-api/tuple.rst

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,8 +148,11 @@ Tuple Objects
148148
Struct Sequence Objects
149149
-----------------------
150150
151-
Struct sequence objects are the C equivalent of :func:`~collections.namedtuple`
152-
objects, i.e. a sequence whose items can also be accessed through attributes.
151+
A struct sequence object is a :term:`named tuple`, that is, a sequence
152+
whose items can also be accessed through attributes.
153+
It is similar to :func:`collections.namedtuple`, but provides a slightly
154+
different interface.
155+
153156
To create a struct sequence, you first have to create a specific struct sequence
154157
type.
155158

Doc/c-api/type.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,7 @@ Type Objects
317317
and other places where a method's defining class cannot be passed using the
318318
:c:type:`PyCMethod` calling convention.
319319
320-
.. versionadded:: next
320+
.. versionadded:: 3.15
321321
322322
323323
.. c:function:: PyObject* PyType_GetModuleByDef(PyTypeObject *type, struct PyModuleDef *def)

Doc/deprecations/pending-removal-in-3.20.rst

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
Pending removal in Python 3.20
22
------------------------------
33

4-
* The ``__version__`` attribute has been deprecated in these standard library
5-
modules and will be removed in Python 3.20.
6-
Use :py:data:`sys.version_info` instead.
4+
* The ``__version__``, ``version`` and ``VERSION`` attributes have been
5+
deprecated in these standard library modules and will be removed in
6+
Python 3.20. Use :py:data:`sys.version_info` instead.
77

88
- :mod:`argparse`
99
- :mod:`csv`
@@ -23,6 +23,10 @@ Pending removal in Python 3.20
2323
- :mod:`tabnanny`
2424
- :mod:`tkinter.font`
2525
- :mod:`tkinter.ttk`
26+
- :mod:`wsgiref.simple_server`
27+
- :mod:`xml.etree.ElementTree`
28+
- :mod:`!xml.sax.expatreader`
29+
- :mod:`xml.sax.handler`
2630
- :mod:`zlib`
2731

2832
(Contributed by Hugo van Kemenade and Stan Ulbrych in :gh:`76007`.)

0 commit comments

Comments
 (0)