Skip to content

Commit c1b64f0

Browse files
authored
Merge branch 'main' into intern-dataclass-field-names
2 parents 6b61dbd + cc13eab commit c1b64f0

File tree

657 files changed

+29547
-18382
lines changed

Some content is hidden

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

657 files changed

+29547
-18382
lines changed

.gitattributes

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ Include/internal/pycore_ast_state.h generated
7676
Include/internal/pycore_opcode.h generated
7777
Include/internal/pycore_opcode_metadata.h generated
7878
Include/internal/pycore_*_generated.h generated
79+
Include/internal/pycore_uop_ids.h generated
7980
Include/opcode.h generated
8081
Include/opcode_ids.h generated
8182
Include/token.h generated
@@ -84,6 +85,7 @@ Lib/keyword.py generated
8485
Lib/test/levenshtein_examples.json generated
8586
Lib/test/test_stable_abi_ctypes.py generated
8687
Lib/token.py generated
88+
Misc/sbom.spdx.json generated
8789
Objects/typeslots.inc generated
8890
PC/python3dll.c generated
8991
Parser/parser.c generated
@@ -92,7 +94,6 @@ Programs/test_frozenmain.h generated
9294
Python/Python-ast.c generated
9395
Python/executor_cases.c.h generated
9496
Python/generated_cases.c.h generated
95-
Python/abstract_interp_cases.c.h generated
9697
Python/opcode_targets.h generated
9798
Python/stdlib_module_names.h generated
9899
Tools/peg_generator/pegen/grammar_parser.py generated

.github/CODEOWNERS

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ Lib/test/test_patma.py @brandtbucher
4040
Lib/test/test_peepholer.py @brandtbucher
4141
Lib/test/test_type_*.py @JelleZijlstra
4242
Lib/test/test_capi/test_misc.py @markshannon @gvanrossum
43+
Tools/c-analyzer/ @ericsnowcurrently
4344

4445
# Exceptions
4546
Lib/traceback.py @iritkatriel
@@ -156,6 +157,8 @@ Doc/c-api/stable.rst @encukou
156157

157158
**/*dataclasses* @ericvsmith
158159

160+
**/*ensurepip* @pfmoore @pradyunsg
161+
159162
**/*idlelib* @terryjreedy
160163

161164
**/*typing* @JelleZijlstra @AlexWaygood
@@ -188,5 +191,14 @@ Doc/c-api/stable.rst @encukou
188191
/Lib/test/test_clinic.py @erlend-aasland @AlexWaygood
189192
Doc/howto/clinic.rst @erlend-aasland
190193

194+
# Subinterpreters
195+
Lib/test/support/interpreters/ @ericsnowcurrently
196+
Modules/_xx*interp*module.c @ericsnowcurrently
197+
Lib/test/test_interpreters/ @ericsnowcurrently
198+
191199
# WebAssembly
192200
/Tools/wasm/ @brettcannon
201+
202+
# SBOM
203+
/Misc/sbom.spdx.json @sethmlarson
204+
/Tools/build/generate_sbom.py @sethmlarson

.github/workflows/mypy.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ on:
99
paths:
1010
- ".github/workflows/mypy.yml"
1111
- "Lib/test/libregrtest/**"
12+
- "Tools/build/generate_sbom.py"
1213
- "Tools/cases_generator/**"
1314
- "Tools/clinic/**"
1415
- "Tools/peg_generator/**"
@@ -34,6 +35,7 @@ jobs:
3435
matrix:
3536
target: [
3637
"Lib/test/libregrtest",
38+
"Tools/build/",
3739
"Tools/cases_generator",
3840
"Tools/clinic",
3941
"Tools/peg_generator",

.github/workflows/posix-deps-apt.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ apt-get -yq install \
2121
libssl-dev \
2222
lzma \
2323
lzma-dev \
24+
strace \
2425
tk-dev \
2526
uuid-dev \
2627
xvfb \

.github/workflows/reusable-windows.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
steps:
1717
- uses: actions/checkout@v4
1818
- name: Build CPython
19-
run: .\PCbuild\build.bat -e -d -p Win32 ${{ inputs.free-threaded && '--disable-gil' || '' }}
19+
run: .\PCbuild\build.bat -e -d -v -p Win32 ${{ inputs.free-threaded && '--disable-gil' || '' }}
2020
- name: Display build info
2121
run: .\python.bat -m test.pythoninfo
2222
- name: Tests
@@ -33,7 +33,7 @@ jobs:
3333
- name: Register MSVC problem matcher
3434
run: echo "::add-matcher::.github/problem-matchers/msvc.json"
3535
- name: Build CPython
36-
run: .\PCbuild\build.bat -e -d -p x64 ${{ inputs.free-threaded && '--disable-gil' || '' }}
36+
run: .\PCbuild\build.bat -e -d -v -p x64 ${{ inputs.free-threaded && '--disable-gil' || '' }}
3737
- name: Display build info
3838
run: .\python.bat -m test.pythoninfo
3939
- name: Tests
@@ -50,4 +50,4 @@ jobs:
5050
- name: Register MSVC problem matcher
5151
run: echo "::add-matcher::.github/problem-matchers/msvc.json"
5252
- name: Build CPython
53-
run: .\PCbuild\build.bat -e -d -p arm64 ${{ inputs.free-threaded && '--disable-gil' || '' }}
53+
run: .\PCbuild\build.bat -e -d -v -p arm64 ${{ inputs.free-threaded && '--disable-gil' || '' }}

.pre-commit-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
repos:
22
- repo: https://github.com/astral-sh/ruff-pre-commit
3-
rev: v0.1.2
3+
rev: v0.1.7
44
hooks:
55
- id: ruff
66
name: Run Ruff on Lib/test/
@@ -24,7 +24,7 @@ repos:
2424
types_or: [c, inc, python, rst]
2525

2626
- repo: https://github.com/sphinx-contrib/sphinx-lint
27-
rev: v0.8.1
27+
rev: v0.9.1
2828
hooks:
2929
- id: sphinx-lint
3030
args: [--enable=default-role]

Doc/Makefile

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,12 @@ SPHINXERRORHANDLING = -W
1919
PAPEROPT_a4 = -D latex_elements.papersize=a4paper
2020
PAPEROPT_letter = -D latex_elements.papersize=letterpaper
2121

22-
ALLSPHINXOPTS = -b $(BUILDER) -d build/doctrees $(PAPEROPT_$(PAPER)) -j $(JOBS) \
23-
$(SPHINXOPTS) $(SPHINXERRORHANDLING) . build/$(BUILDER) $(SOURCES)
22+
ALLSPHINXOPTS = -b $(BUILDER) \
23+
-d build/doctrees \
24+
-j $(JOBS) \
25+
$(PAPEROPT_$(PAPER)) \
26+
$(SPHINXOPTS) $(SPHINXERRORHANDLING) \
27+
. build/$(BUILDER) $(SOURCES)
2428

2529
.PHONY: help
2630
help:
@@ -142,7 +146,7 @@ htmlview: html
142146

143147
.PHONY: htmllive
144148
htmllive: SPHINXBUILD = $(VENVDIR)/bin/sphinx-autobuild
145-
htmllive: SPHINXOPTS = --re-ignore="/venv/"
149+
htmllive: SPHINXOPTS = --re-ignore="/venv/" --open-browser --delay 0
146150
htmllive: html
147151

148152
.PHONY: clean

Doc/c-api/arg.rst

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -413,7 +413,7 @@ API Functions
413413
than a variable number of arguments.
414414
415415
416-
.. c:function:: int PyArg_ParseTupleAndKeywords(PyObject *args, PyObject *kw, const char *format, char *keywords[], ...)
416+
.. c:function:: int PyArg_ParseTupleAndKeywords(PyObject *args, PyObject *kw, const char *format, char * const *keywords, ...)
417417
418418
Parse the parameters of a function that takes both positional and keyword
419419
parameters into local variables.
@@ -424,15 +424,24 @@ API Functions
424424
Returns true on success; on failure, it returns false and raises the
425425
appropriate exception.
426426
427+
.. note::
428+
429+
The *keywords* parameter declaration is :c:expr:`char * const *` in C and
430+
:c:expr:`const char * const *` in C++.
431+
This can be overridden with the :c:macro:`PY_CXX_CONST` macro.
432+
427433
.. versionchanged:: 3.6
428434
Added support for :ref:`positional-only parameters
429435
<positional-only_parameter>`.
430436
431437
.. versionchanged:: 3.13
438+
The *keywords* parameter has now type :c:expr:`char * const *` in C and
439+
:c:expr:`const char * const *` in C++, instead of :c:expr:`char **`.
432440
Added support for non-ASCII keyword parameter names.
433441
434442
435-
.. c:function:: int PyArg_VaParseTupleAndKeywords(PyObject *args, PyObject *kw, const char *format, char *keywords[], va_list vargs)
443+
444+
.. c:function:: int PyArg_VaParseTupleAndKeywords(PyObject *args, PyObject *kw, const char *format, char * const *keywords, va_list vargs)
436445
437446
Identical to :c:func:`PyArg_ParseTupleAndKeywords`, except that it accepts a
438447
va_list rather than a variable number of arguments.
@@ -505,6 +514,19 @@ API Functions
505514
506515
PyArg_ParseTuple(args, "O|O:ref", &object, &callback)
507516
517+
.. c:macro:: PY_CXX_CONST
518+
519+
The value to be inserted, if any, before :c:expr:`char * const *`
520+
in the *keywords* parameter declaration of
521+
:c:func:`PyArg_ParseTupleAndKeywords` and
522+
:c:func:`PyArg_VaParseTupleAndKeywords`.
523+
Default empty for C and ``const`` for C++
524+
(:c:expr:`const char * const *`).
525+
To override, define it to the desired value before including
526+
:file:`Python.h`.
527+
528+
.. versionadded:: 3.13
529+
508530
509531
---------------
510532
Building values

Doc/c-api/exceptions.rst

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -541,7 +541,8 @@ Querying the error indicator
541541
542542
.. note::
543543
544-
This function *does not* implicitly set the ``__traceback__``
544+
This function *does not* implicitly set the
545+
:attr:`~BaseException.__traceback__`
545546
attribute on the exception value. If setting the traceback
546547
appropriately is desired, the following additional snippet is needed::
547548
@@ -753,7 +754,8 @@ Exception Objects
753754
.. c:function:: PyObject* PyException_GetTraceback(PyObject *ex)
754755
755756
Return the traceback associated with the exception as a new reference, as
756-
accessible from Python through :attr:`__traceback__`. If there is no
757+
accessible from Python through the :attr:`~BaseException.__traceback__`
758+
attribute. If there is no
757759
traceback associated, this returns ``NULL``.
758760
759761
@@ -767,8 +769,8 @@ Exception Objects
767769
768770
Return the context (another exception instance during whose handling *ex* was
769771
raised) associated with the exception as a new reference, as accessible from
770-
Python through :attr:`__context__`. If there is no context associated, this
771-
returns ``NULL``.
772+
Python through the :attr:`~BaseException.__context__` attribute.
773+
If there is no context associated, this returns ``NULL``.
772774
773775
774776
.. c:function:: void PyException_SetContext(PyObject *ex, PyObject *ctx)
@@ -782,7 +784,8 @@ Exception Objects
782784
783785
Return the cause (either an exception instance, or ``None``,
784786
set by ``raise ... from ...``) associated with the exception as a new
785-
reference, as accessible from Python through :attr:`__cause__`.
787+
reference, as accessible from Python through the
788+
:attr:`~BaseException.__cause__` attribute.
786789
787790
788791
.. c:function:: void PyException_SetCause(PyObject *ex, PyObject *cause)
@@ -791,7 +794,8 @@ Exception Objects
791794
it. There is no type check to make sure that *cause* is either an exception
792795
instance or ``None``. This steals a reference to *cause*.
793796
794-
:attr:`__suppress_context__` is implicitly set to ``True`` by this function.
797+
The :attr:`~BaseException.__suppress_context__` attribute is implicitly set
798+
to ``True`` by this function.
795799
796800
797801
.. c:function:: PyObject* PyException_GetArgs(PyObject *ex)

Doc/c-api/frame.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ See also :ref:`Reflection <reflection>`.
5050
5151
.. c:function:: PyObject* PyFrame_GetBuiltins(PyFrameObject *frame)
5252
53-
Get the *frame*'s ``f_builtins`` attribute.
53+
Get the *frame*'s :attr:`~frame.f_builtins` attribute.
5454
5555
Return a :term:`strong reference`. The result cannot be ``NULL``.
5656
@@ -81,7 +81,7 @@ See also :ref:`Reflection <reflection>`.
8181
8282
.. c:function:: PyObject* PyFrame_GetGlobals(PyFrameObject *frame)
8383
84-
Get the *frame*'s ``f_globals`` attribute.
84+
Get the *frame*'s :attr:`~frame.f_globals` attribute.
8585
8686
Return a :term:`strong reference`. The result cannot be ``NULL``.
8787
@@ -90,7 +90,7 @@ See also :ref:`Reflection <reflection>`.
9090
9191
.. c:function:: int PyFrame_GetLasti(PyFrameObject *frame)
9292
93-
Get the *frame*'s ``f_lasti`` attribute.
93+
Get the *frame*'s :attr:`~frame.f_lasti` attribute.
9494
9595
Returns -1 if ``frame.f_lasti`` is ``None``.
9696
@@ -120,7 +120,7 @@ See also :ref:`Reflection <reflection>`.
120120
121121
.. c:function:: PyObject* PyFrame_GetLocals(PyFrameObject *frame)
122122
123-
Get the *frame*'s ``f_locals`` attribute (:class:`dict`).
123+
Get the *frame*'s :attr:`~frame.f_locals` attribute (:class:`dict`).
124124
125125
Return a :term:`strong reference`.
126126

0 commit comments

Comments
 (0)