Skip to content

Commit 47f3d81

Browse files
authored
Merge branch 'main' into fix-issue-129069
2 parents 0f96d58 + 71009cb commit 47f3d81

File tree

241 files changed

+11983
-1372
lines changed

Some content is hidden

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

241 files changed

+11983
-1372
lines changed

.github/workflows/tail-call.yml

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ jobs:
4545
- aarch64-unknown-linux-gnu/gcc
4646
- free-threading
4747
llvm:
48-
- 19
48+
- 20
4949
include:
5050
# - target: i686-pc-windows-msvc/msvc
5151
# architecture: Win32
@@ -83,9 +83,9 @@ jobs:
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.5
86+
choco install llvm --allow-downgrade --no-progress --version ${{ matrix.llvm }}.1.0
8787
set PlatformToolset=clangcl
88-
set LLVMToolsVersion=${{ matrix.llvm }}.1.5
88+
set LLVMToolsVersion=${{ matrix.llvm }}.1.0
8989
set LLVMInstallDir=C:\Program Files\LLVM
9090
call ./PCbuild/build.bat --tail-call-interp -d -p ${{ matrix.architecture }}
9191
call ./PCbuild/rt.bat -d -p ${{ matrix.architecture }} -q --multiprocess 0 --timeout 4500 --verbose2 --verbose3
@@ -95,26 +95,28 @@ jobs:
9595
if: runner.os == 'Windows' && matrix.architecture == 'ARM64'
9696
shell: cmd
9797
run: |
98-
choco install llvm --allow-downgrade --no-progress --version ${{ matrix.llvm }}.1.5
98+
choco install llvm --allow-downgrade --no-progress --version ${{ matrix.llvm }}.1.0
9999
set PlatformToolset=clangcl
100-
set LLVMToolsVersion=${{ matrix.llvm }}.1.5
100+
set LLVMToolsVersion=${{ matrix.llvm }}.1.0
101101
set LLVMInstallDir=C:\Program Files\LLVM
102102
./PCbuild/build.bat --tail-call-interp -p ${{ matrix.architecture }}
103103
104104
# The `find` line is required as a result of https://github.com/actions/runner-images/issues/9966.
105105
# This is a bug in the macOS runner image where the pre-installed Python is installed in the same
106106
# directory as the Homebrew Python, which causes the build to fail for macos-13. This line removes
107107
# the symlink to the pre-installed Python so that the Homebrew Python is used instead.
108+
# Note: when a new LLVM is released, the homebrew installation directory changes, so the builds will fail.
109+
# We either need to upgrade LLVM or change the directory being pointed to.
108110
- name: Native macOS (release)
109111
if: runner.os == 'macOS'
110112
run: |
111113
brew update
112114
find /usr/local/bin -lname '*/Library/Frameworks/Python.framework/*' -delete
113115
brew install llvm@${{ matrix.llvm }}
114116
export SDKROOT="$(xcrun --show-sdk-path)"
115-
export PATH="/opt/homebrew/opt/llvm@${{ matrix.llvm }}/bin:$PATH"
116-
export PATH="/usr/local/opt/llvm@${{ matrix.llvm }}/bin:$PATH"
117-
CC=clang-19 ./configure --with-tail-call-interp
117+
export PATH="/usr/local/opt/llvm/bin:$PATH"
118+
export PATH="/opt/homebrew/opt/llvm/bin:$PATH"
119+
CC=clang-20 ./configure --with-tail-call-interp
118120
make all --jobs 4
119121
./python.exe -m test --multiprocess 0 --timeout 4500 --verbose2 --verbose3
120122
@@ -123,7 +125,7 @@ jobs:
123125
run: |
124126
sudo bash -c "$(wget -O - https://apt.llvm.org/llvm.sh)" ./llvm.sh ${{ matrix.llvm }}
125127
export PATH="$(llvm-config-${{ matrix.llvm }} --bindir):$PATH"
126-
CC=clang-19 ./configure --with-tail-call-interp --with-pydebug
128+
CC=clang-20 ./configure --with-tail-call-interp --with-pydebug
127129
make all --jobs 4
128130
./python -m test --multiprocess 0 --timeout 4500 --verbose2 --verbose3
129131
@@ -132,7 +134,7 @@ jobs:
132134
run: |
133135
sudo bash -c "$(wget -O - https://apt.llvm.org/llvm.sh)" ./llvm.sh ${{ matrix.llvm }}
134136
export PATH="$(llvm-config-${{ matrix.llvm }} --bindir):$PATH"
135-
CC=clang-19 ./configure --with-tail-call-interp --disable-gil
137+
CC=clang-20 ./configure --with-tail-call-interp --disable-gil
136138
make all --jobs 4
137139
./python -m test --multiprocess 0 --timeout 4500 --verbose2 --verbose3
138140

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ tags
3838
TAGS
3939
.vs/
4040
.vscode/
41+
.cache/
4142
gmon.out
4243
.coverage
4344
.mypy_cache/

Doc/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,7 @@ dist-html:
204204
find dist -name 'python-$(DISTVERSION)-docs-html*' -exec rm -rf {} \;
205205
$(MAKE) html
206206
cp -pPR build/html dist/python-$(DISTVERSION)-docs-html
207+
rm -rf dist/python-$(DISTVERSION)-docs-html/_images/social_previews/
207208
tar -C dist -cf dist/python-$(DISTVERSION)-docs-html.tar python-$(DISTVERSION)-docs-html
208209
bzip2 -9 -k dist/python-$(DISTVERSION)-docs-html.tar
209210
(cd dist; zip -q -r -9 python-$(DISTVERSION)-docs-html.zip python-$(DISTVERSION)-docs-html)

Doc/c-api/arg.rst

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -357,11 +357,26 @@ Other objects
357357

358358
.. versionadded:: 3.3
359359

360-
``(items)`` (:class:`tuple`) [*matching-items*]
361-
The object must be a Python sequence whose length is the number of format units
360+
``(items)`` (sequence) [*matching-items*]
361+
The object must be a Python sequence (except :class:`str`, :class:`bytes`
362+
or :class:`bytearray`) whose length is the number of format units
362363
in *items*. The C arguments must correspond to the individual format units in
363364
*items*. Format units for sequences may be nested.
364365

366+
If *items* contains format units which store a :ref:`borrowed buffer
367+
<c-arg-borrowed-buffer>` (``s``, ``s#``, ``z``, ``z#``, ``y``, or ``y#``)
368+
or a :term:`borrowed reference` (``S``, ``Y``, ``U``, ``O``, or ``O!``),
369+
the object must be a Python tuple.
370+
The *converter* for the ``O&`` format unit in *items* must not store
371+
a borrowed buffer or a borrowed reference.
372+
373+
.. versionchanged:: next
374+
:class:`str` and :class:`bytearray` objects no longer accepted as a sequence.
375+
376+
.. deprecated:: next
377+
Non-tuple sequences are deprecated if *items* contains format units
378+
which store a borrowed buffer or a borrowed reference.
379+
365380
A few other characters have a meaning in a format string. These may not occur
366381
inside nested parentheses. They are:
367382

Doc/c-api/monitoring.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,6 @@ would typically correspond to a python function.
205205
206206
.. versionadded:: 3.13
207207
208-
.. deprecated:: next
208+
.. deprecated:: 3.14
209209
210210
This function is :term:`soft deprecated`.

Doc/conf.py

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -624,11 +624,19 @@
624624
# Options for sphinxext-opengraph
625625
# -------------------------------
626626

627-
ogp_site_url = 'https://docs.python.org/3/'
627+
ogp_canonical_url = 'https://docs.python.org/3/'
628628
ogp_site_name = 'Python documentation'
629-
ogp_image = '_static/og-image.png'
629+
ogp_social_cards = { # Used when matplotlib is installed
630+
'image': '_static/og-image.png',
631+
'line_color': '#3776ab',
632+
}
630633
ogp_custom_meta_tags = [
631-
'<meta property="og:image:width" content="200" />',
632-
'<meta property="og:image:height" content="200" />',
633-
'<meta name="theme-color" content="#3776ab" />',
634+
'<meta name="theme-color" content="#3776ab">',
634635
]
636+
if 'create-social-cards' not in tags: # noqa: F821
637+
# Define a static preview image when not creating social cards
638+
ogp_image = '_static/og-image.png'
639+
ogp_custom_meta_tags += [
640+
'<meta property="og:image:width" content="200">',
641+
'<meta property="og:image:height" content="200">',
642+
]

Doc/faq/programming.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1868,15 +1868,15 @@ object identity is assured. Generally, there are three circumstances where
18681868
identity is guaranteed:
18691869

18701870
1) Assignments create new names but do not change object identity. After the
1871-
assignment ``new = old``, it is guaranteed that ``new is old``.
1871+
assignment ``new = old``, it is guaranteed that ``new is old``.
18721872

18731873
2) Putting an object in a container that stores object references does not
1874-
change object identity. After the list assignment ``s[0] = x``, it is
1875-
guaranteed that ``s[0] is x``.
1874+
change object identity. After the list assignment ``s[0] = x``, it is
1875+
guaranteed that ``s[0] is x``.
18761876

18771877
3) If an object is a singleton, it means that only one instance of that object
1878-
can exist. After the assignments ``a = None`` and ``b = None``, it is
1879-
guaranteed that ``a is b`` because ``None`` is a singleton.
1878+
can exist. After the assignments ``a = None`` and ``b = None``, it is
1879+
guaranteed that ``a is b`` because ``None`` is a singleton.
18801880

18811881
In most other circumstances, identity tests are inadvisable and equality tests
18821882
are preferred. In particular, identity tests should not be used to check

Doc/includes/email-alternative.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
recette
3737
</a> sera sûrement un très bon repas.
3838
</p>
39-
<img src="cid:{asparagus_cid}" />
39+
<img src="cid:{asparagus_cid}">
4040
</body>
4141
</html>
4242
""".format(asparagus_cid=asparagus_cid[1:-1]), subtype='html')

Doc/library/annotationlib.rst

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -204,12 +204,6 @@ Classes
204204
means may not have any information about their scope, so passing
205205
arguments to this method may be necessary to evaluate them successfully.
206206

207-
.. important::
208-
209-
Once a :class:`~ForwardRef` instance has been evaluated, it caches
210-
the evaluated value, and future calls to :meth:`evaluate` will return
211-
the cached value, regardless of the parameters passed in.
212-
213207
.. versionadded:: 3.14
214208

215209

Doc/library/cmath.rst

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,57 @@ the function is then applied to the result of the conversion.
3838
1.4142135623730951j
3939

4040

41+
==================================================== ============================================
42+
**Conversions to and from polar coordinates**
43+
--------------------------------------------------------------------------------------------------
44+
:func:`phase(z) <phase>` Return the phase of *z*
45+
:func:`polar(z) <polar>` Return the representation of *z* in polar coordinates
46+
:func:`rect(r, phi) <rect>` Return the complex number *z* with polar coordinates *r* and *phi*
47+
48+
**Power and logarithmic functions**
49+
--------------------------------------------------------------------------------------------------
50+
:func:`exp(z) <exp>` Return *e* raised to the power *z*
51+
:func:`log(z[, base]) <log>` Return the logarithm of *z* to the given *base* (*e* by default)
52+
:func:`log10(z) <log10>` Return the base-10 logarithm of *z*
53+
:func:`sqrt(z) <sqrt>` Return the square root of *z*
54+
55+
**Trigonometric functions**
56+
--------------------------------------------------------------------------------------------------
57+
:func:`acos(z) <acos>` Return the arc cosine of *z*
58+
:func:`asin(z) <asin>` Return the arc sine of *z*
59+
:func:`atan(z) <atan>` Return the arc tangent of *z*
60+
:func:`cos(z) <cos>` Return the cosine of *z*
61+
:func:`sin(z) <sin>` Return the sine of *z*
62+
:func:`tan(z) <tan>` Return the tangent of *z*
63+
64+
**Hyperbolic functions**
65+
--------------------------------------------------------------------------------------------------
66+
:func:`acosh(z) <acosh>` Return the inverse hyperbolic cosine of *z*
67+
:func:`asinh(z) <asinh>` Return the inverse hyperbolic sine of *z*
68+
:func:`atanh(z) <atanh>` Return the inverse hyperbolic tangent of *z*
69+
:func:`cosh(z) <cosh>` Return the hyperbolic cosine of *z*
70+
:func:`sinh(z) <sinh>` Return the hyperbolic sine of *z*
71+
:func:`tanh(z) <tanh>` Return the hyperbolic tangent of *z*
72+
73+
**Classification functions**
74+
--------------------------------------------------------------------------------------------------
75+
:func:`isfinite(z) <isfinite>` Check if all components of *z* are finite
76+
:func:`isinf(z) <isinf>` Check if any component of *z* is infinite
77+
:func:`isnan(z) <isnan>` Check if any component of *z* is a NaN
78+
:func:`isclose(a, b, *, rel_tol, abs_tol) <isclose>` Check if the values *a* and *b* are close to each other
79+
80+
**Constants**
81+
--------------------------------------------------------------------------------------------------
82+
:data:`pi` *π* = 3.141592...
83+
:data:`e` *e* = 2.718281...
84+
:data:`tau` *τ* = 2\ *π* = 6.283185...
85+
:data:`inf` Positive infinity
86+
:data:`infj` Pure imaginary infinity
87+
:data:`nan` "Not a number" (NaN)
88+
:data:`nanj` Pure imaginary NaN
89+
==================================================== ============================================
90+
91+
4192
Conversions to and from polar coordinates
4293
-----------------------------------------
4394

0 commit comments

Comments
 (0)