Skip to content

Commit 867ebf1

Browse files
committed
Merge remote-tracking branch 'upstream/main' into ci/update/ssl-versions-131423
2 parents 905f1a5 + c55c020 commit 867ebf1

File tree

60 files changed

+724
-175
lines changed

Some content is hidden

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

60 files changed

+724
-175
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/conf.py

Lines changed: 12 additions & 4 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" />',
633634
'<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/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

Doc/library/ctypes.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2632,6 +2632,9 @@ These are the fundamental ctypes data types:
26322632
Represents the C :c:expr:`PyObject *` datatype. Calling this without an
26332633
argument creates a ``NULL`` :c:expr:`PyObject *` pointer.
26342634

2635+
.. versionchanged:: next
2636+
:class:`!py_object` is now a :term:`generic type`.
2637+
26352638
The :mod:`!ctypes.wintypes` module provides quite some other Windows specific
26362639
data types, for example :c:type:`!HWND`, :c:type:`!WPARAM`, or :c:type:`!DWORD`.
26372640
Some useful structures like :c:type:`!MSG` or :c:type:`!RECT` are also defined.

Doc/library/zipfile.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -538,6 +538,14 @@ The following data attributes are also available:
538538
it should be no longer than 65535 bytes. Comments longer than this will be
539539
truncated.
540540

541+
.. attribute:: ZipFile.data_offset
542+
543+
The offset to the start of ZIP data from the beginning of the file. When the
544+
:class:`ZipFile` is opened in either mode ``'w'`` or ``'x'`` and the
545+
underlying file does not support ``tell()``, the value will be ``None``
546+
instead.
547+
548+
.. versionadded:: 3.14
541549

542550
.. _path-objects:
543551

Doc/requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ sphinx~=8.2.0
1111

1212
blurb
1313

14-
sphinxext-opengraph~=0.9.0
14+
sphinxext-opengraph~=0.10.0
1515
sphinx-notfound-page~=1.0.0
1616

1717
# The theme used by the documentation is stored separately, so we need

Doc/whatsnew/3.14.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -622,6 +622,11 @@ ctypes
622622
loaded by the current process.
623623
(Contributed by Brian Ward in :gh:`119349`.)
624624

625+
* The :class:`ctypes.py_object` type now supports subscription,
626+
making it a :term:`generic type`.
627+
(Contributed by Brian Schubert in :gh:`132168`.)
628+
629+
625630
datetime
626631
--------
627632

@@ -1130,6 +1135,9 @@ typing
11301135
For example, ``isinstance(int | str, typing.Union)`` will return ``True``; previously
11311136
this raised :exc:`TypeError`.
11321137
- The ``__args__`` attribute of :class:`typing.Union` objects is no longer writable.
1138+
- It is no longer possible to set any attributes on :class:`typing.Union` objects.
1139+
This only ever worked for dunder attributes on previous versions, was never
1140+
documented to work, and was subtly broken in many cases.
11331141

11341142
(Contributed by Jelle Zijlstra in :gh:`105499`.)
11351143

0 commit comments

Comments
 (0)