Skip to content

Commit 5bb1d1e

Browse files
committed
Merge remote-tracking branch 'upstream/main' into pep649-fakevalue
2 parents ddacdb7 + 6318ffc commit 5bb1d1e

File tree

100 files changed

+1729
-623
lines changed

Some content is hidden

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

100 files changed

+1729
-623
lines changed

.github/workflows/build.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -195,13 +195,14 @@ jobs:
195195

196196
build_ubuntu_ssltests:
197197
name: 'Ubuntu SSL tests with OpenSSL'
198-
runs-on: ubuntu-22.04
198+
runs-on: ${{ matrix.os }}
199199
timeout-minutes: 60
200200
needs: check_source
201201
if: needs.check_source.outputs.run_tests == 'true'
202202
strategy:
203203
fail-fast: false
204204
matrix:
205+
os: [ubuntu-22.04]
205206
openssl_ver: [3.0.15, 3.1.7, 3.2.3, 3.3.2]
206207
env:
207208
OPENSSL_VER: ${{ matrix.openssl_ver }}
@@ -231,7 +232,7 @@ jobs:
231232
uses: actions/cache@v4
232233
with:
233234
path: ./multissl/openssl/${{ env.OPENSSL_VER }}
234-
key: ${{ runner.os }}-multissl-openssl-${{ env.OPENSSL_VER }}
235+
key: ${{ matrix.os }}-multissl-openssl-${{ env.OPENSSL_VER }}
235236
- name: Install OpenSSL
236237
if: steps.cache-openssl.outputs.cache-hit != 'true'
237238
run: python3 Tools/ssl/multissltests.py --steps=library --base-directory $MULTISSL_DIR --openssl $OPENSSL_VER --system Linux
@@ -410,7 +411,7 @@ jobs:
410411
uses: actions/cache@v4
411412
with:
412413
path: ./multissl/openssl/${{ env.OPENSSL_VER }}
413-
key: ${{ runner.os }}-multissl-openssl-${{ env.OPENSSL_VER }}
414+
key: ${{ matrix.os }}-multissl-openssl-${{ env.OPENSSL_VER }}
414415
- name: Install OpenSSL
415416
if: steps.cache-openssl.outputs.cache-hit != 'true'
416417
run: python3 Tools/ssl/multissltests.py --steps=library --base-directory $MULTISSL_DIR --openssl $OPENSSL_VER --system Linux

.github/workflows/jit.yml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -110,17 +110,15 @@ jobs:
110110
- name: Native Windows
111111
if: runner.os == 'Windows' && matrix.architecture != 'ARM64'
112112
run: |
113-
choco upgrade llvm -y
114-
choco install llvm --allow-downgrade --no-progress --version ${{ matrix.llvm }}
113+
choco install llvm --allow-downgrade --no-progress --version ${{ matrix.llvm }}.1.0
115114
./PCbuild/build.bat --experimental-jit ${{ matrix.debug && '-d' || '--pgo' }} -p ${{ matrix.architecture }}
116115
./PCbuild/rt.bat ${{ matrix.debug && '-d' || '' }} -p ${{ matrix.architecture }} -q --multiprocess 0 --timeout 4500 --verbose2 --verbose3
117116
118117
# No PGO or tests (yet):
119118
- name: Emulated Windows
120119
if: runner.os == 'Windows' && matrix.architecture == 'ARM64'
121120
run: |
122-
choco upgrade llvm -y
123-
choco install llvm --allow-downgrade --no-progress --version ${{ matrix.llvm }}
121+
choco install llvm --allow-downgrade --no-progress --version ${{ matrix.llvm }}.1.0
124122
./PCbuild/build.bat --experimental-jit ${{ matrix.debug && '-d' || '' }} -p ${{ matrix.architecture }}
125123
126124
- name: Native macOS
@@ -159,7 +157,7 @@ jobs:
159157
CC="${{ matrix.compiler == 'clang' && 'clang --target=$HOST' || '$HOST-gcc' }}" \
160158
CPP="$CC --preprocess" \
161159
HOSTRUNNER=qemu-${{ matrix.architecture }} \
162-
./configure --enable-experimental-jit ${{ matrix.debug && '--with-pydebug' || '--enable-optimizations --with-lto' }} --build=x86_64-linux-gnu --host="$HOST" --with-build-python=../build/bin/python3 --with-pkg-config=no ac_cv_buggy_getaddrinfo=no ac_cv_file__dev_ptc=no ac_cv_file__dev_ptmx=yes
160+
./configure --enable-experimental-jit ${{ matrix.debug && '--with-pydebug' || '--with-lto' }} --build=x86_64-linux-gnu --host="$HOST" --with-build-python=../build/bin/python3 --with-pkg-config=no ac_cv_buggy_getaddrinfo=no ac_cv_file__dev_ptc=no ac_cv_file__dev_ptmx=yes
163161
make all --jobs 4
164162
./python -m test --ignorefile=Tools/jit/ignore-tests-emulated-linux.txt --multiprocess 0 --timeout 4500 --verbose2 --verbose3
165163

.github/workflows/reusable-ubuntu.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,11 @@ jobs:
1414
build_ubuntu_reusable:
1515
name: 'build and test'
1616
timeout-minutes: 60
17-
runs-on: ubuntu-22.04
17+
runs-on: ${{ matrix.os }}
18+
strategy:
19+
fail-fast: false
20+
matrix:
21+
os: [ubuntu-22.04]
1822
env:
1923
FORCE_COLOR: 1
2024
OPENSSL_VER: 3.0.15
@@ -36,7 +40,7 @@ jobs:
3640
uses: actions/cache@v4
3741
with:
3842
path: ./multissl/openssl/${{ env.OPENSSL_VER }}
39-
key: ${{ runner.os }}-multissl-openssl-${{ env.OPENSSL_VER }}
43+
key: ${{ matrix.os }}-multissl-openssl-${{ env.OPENSSL_VER }}
4044
- name: Install OpenSSL
4145
if: steps.cache-openssl.outputs.cache-hit != 'true'
4246
run: python3 Tools/ssl/multissltests.py --steps=library --base-directory $MULTISSL_DIR --openssl $OPENSSL_VER --system Linux

Doc/data/stable_abi.dat

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Doc/library/argparse.rst

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -249,11 +249,12 @@ The following sections describe how each of these are used.
249249
prog
250250
^^^^
251251

252-
By default, :class:`ArgumentParser` objects use ``sys.argv[0]`` to determine
252+
By default, :class:`ArgumentParser` objects use the base name
253+
(see :func:`os.path.basename`) of ``sys.argv[0]`` to determine
253254
how to display the name of the program in help messages. This default is almost
254-
always desirable because it will make the help messages match how the program was
255-
invoked on the command line. For example, consider a file named
256-
``myprogram.py`` with the following code::
255+
always desirable because it will make the help messages match the name that was
256+
used to invoke the program on the command line. For example, consider a file
257+
named ``myprogram.py`` with the following code::
257258

258259
import argparse
259260
parser = argparse.ArgumentParser()
@@ -1122,6 +1123,9 @@ is used when no command-line argument was present::
11221123
>>> parser.parse_args([])
11231124
Namespace(foo=42)
11241125

1126+
For required_ arguments, the ``default`` value is ignored. For example, this
1127+
applies to positional arguments with nargs_ values other than ``?`` or ``*``,
1128+
or optional arguments marked as ``required=True``.
11251129

11261130
Providing ``default=argparse.SUPPRESS`` causes no attribute to be added if the
11271131
command-line argument was not present::

Doc/library/calendar.rst

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -393,13 +393,22 @@ The :mod:`calendar` module exports the following data attributes:
393393

394394
.. data:: day_name
395395

396-
An array that represents the days of the week in the current locale.
396+
A sequence that represents the days of the week in the current locale,
397+
where Monday is day number 0.
398+
399+
>>> import calendar
400+
>>> list(calendar.day_name)
401+
['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday']
397402

398403

399404
.. data:: day_abbr
400405

401-
An array that represents the abbreviated days of the week in the current locale.
406+
A sequence that represents the abbreviated days of the week in the current locale,
407+
where Mon is day number 0.
402408

409+
>>> import calendar
410+
>>> list(calendar.day_abbr)
411+
['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']
403412

404413
.. data:: MONDAY
405414
TUESDAY
@@ -426,17 +435,24 @@ The :mod:`calendar` module exports the following data attributes:
426435

427436
.. data:: month_name
428437

429-
An array that represents the months of the year in the current locale. This
438+
A sequence that represents the months of the year in the current locale. This
430439
follows normal convention of January being month number 1, so it has a length of
431440
13 and ``month_name[0]`` is the empty string.
432441

442+
>>> import calendar
443+
>>> list(calendar.month_name)
444+
['', 'January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December']
445+
433446

434447
.. data:: month_abbr
435448

436-
An array that represents the abbreviated months of the year in the current
449+
A sequence that represents the abbreviated months of the year in the current
437450
locale. This follows normal convention of January being month number 1, so it
438451
has a length of 13 and ``month_abbr[0]`` is the empty string.
439452

453+
>>> import calendar
454+
>>> list(calendar.month_abbr)
455+
['', 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']
440456

441457
.. data:: JANUARY
442458
FEBRUARY

Doc/library/dataclasses.rst

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -187,13 +187,6 @@ Module contents
187187
If :attr:`!__slots__` is already defined in the class, then :exc:`TypeError`
188188
is raised.
189189

190-
.. warning::
191-
Calling no-arg :func:`super` in dataclasses using ``slots=True``
192-
will result in the following exception being raised:
193-
``TypeError: super(type, obj): obj must be an instance or subtype of type``.
194-
The two-arg :func:`super` is a valid workaround.
195-
See :gh:`90562` for full details.
196-
197190
.. warning::
198191
Passing parameters to a base class :meth:`~object.__init_subclass__`
199192
when using ``slots=True`` will result in a :exc:`TypeError`.

Doc/library/dis.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1872,6 +1872,12 @@ but are replaced by real opcodes or removed before bytecode is generated.
18721872
Undirected relative jump instructions which are replaced by their
18731873
directed (forward/backward) counterparts by the assembler.
18741874

1875+
.. opcode:: JUMP_IF_TRUE
1876+
.. opcode:: JUMP_IF_FALSE
1877+
1878+
Conditional jumps which do not impact the stack. Replaced by the sequence
1879+
``COPY 1``, ``TO_BOOL``, ``POP_JUMP_IF_TRUE/FALSE``.
1880+
18751881
.. opcode:: LOAD_CLOSURE (i)
18761882

18771883
Pushes a reference to the cell contained in slot ``i`` of the "fast locals"

Doc/library/os.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4602,7 +4602,7 @@ written in Python, such as a mail server's external command delivery program.
46024602

46034603
See the :manpage:`pidfd_open(2)` man page for more details.
46044604

4605-
.. availability:: Linux >= 5.3
4605+
.. availability:: Linux >= 5.3, Android >= :func:`build-time <sys.getandroidapilevel>` API level 31
46064606
.. versionadded:: 3.9
46074607

46084608
.. data:: PIDFD_NONBLOCK

Doc/library/pdb.rst

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -159,12 +159,15 @@ slightly different way:
159159
is entered.
160160

161161

162-
.. function:: set_trace(*, header=None)
162+
.. function:: set_trace(*, header=None, commands=None)
163163

164164
Enter the debugger at the calling stack frame. This is useful to hard-code
165165
a breakpoint at a given point in a program, even if the code is not
166166
otherwise being debugged (e.g. when an assertion fails). If given,
167167
*header* is printed to the console just before debugging begins.
168+
The *commands* argument, if given, is a list of commands to execute
169+
when the debugger starts.
170+
168171

169172
.. versionchanged:: 3.7
170173
The keyword-only argument *header*.
@@ -173,6 +176,9 @@ slightly different way:
173176
:func:`set_trace` will enter the debugger immediately, rather than
174177
on the next line of code to be executed.
175178

179+
.. versionadded:: 3.14
180+
The *commands* argument.
181+
176182
.. function:: post_mortem(traceback=None)
177183

178184
Enter post-mortem debugging of the given *traceback* object. If no
@@ -192,7 +198,7 @@ The ``run*`` functions and :func:`set_trace` are aliases for instantiating the
192198
access further features, you have to do this yourself:
193199

194200
.. class:: Pdb(completekey='tab', stdin=None, stdout=None, skip=None, \
195-
nosigint=False, readrc=True)
201+
nosigint=False, readrc=True, mode=None)
196202

197203
:class:`Pdb` is the debugger class.
198204

@@ -211,6 +217,13 @@ access further features, you have to do this yourself:
211217
The *readrc* argument defaults to true and controls whether Pdb will load
212218
.pdbrc files from the filesystem.
213219

220+
The *mode* argument specifies how the debugger was invoked.
221+
It impacts the workings of some debugger commands.
222+
Valid values are ``'inline'`` (used by the breakpoint() builtin),
223+
``'cli'`` (used by the command line invocation)
224+
or ``None`` (for backwards compatible behaviour, as before the *mode*
225+
argument was added).
226+
214227
Example call to enable tracing with *skip*::
215228

216229
import pdb; pdb.Pdb(skip=['django.*']).set_trace()
@@ -227,6 +240,9 @@ access further features, you have to do this yourself:
227240
.. versionchanged:: 3.6
228241
The *readrc* argument.
229242

243+
.. versionadded:: 3.14
244+
Added the *mode* argument.
245+
230246
.. method:: run(statement, globals=None, locals=None)
231247
runeval(expression, globals=None, locals=None)
232248
runcall(function, *args, **kwds)
@@ -669,6 +685,10 @@ can be overridden by the local file.
669685
History, breakpoints, actions and debugger options are preserved.
670686
:pdbcmd:`restart` is an alias for :pdbcmd:`run`.
671687

688+
.. versionchanged:: 3.14
689+
:pdbcmd:`run` and :pdbcmd:`restart` commands are disabled when the
690+
debugger is invoked in ``'inline'`` mode.
691+
672692
.. pdbcommand:: q(uit)
673693

674694
Quit from the debugger. The program being executed is aborted.

0 commit comments

Comments
 (0)