Skip to content

Commit 534b694

Browse files
committed
Merge branch 'main' into account-for-escapes-in-decref-inputs
2 parents c7d3f09 + bff4bfe commit 534b694

File tree

110 files changed

+3914
-3487
lines changed

Some content is hidden

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

110 files changed

+3914
-3487
lines changed

.github/workflows/build.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -247,13 +247,13 @@ jobs:
247247
- true
248248
os:
249249
- ubuntu-24.04
250-
- ubuntu-24.04-arm
250+
- ubuntu-22.04-arm
251251
exclude:
252252
# Do not test BOLT with free-threading, to conserve resources
253253
- bolt: true
254254
free-threading: true
255255
# BOLT currently crashes during instrumentation on aarch64
256-
- os: ubuntu-24.04-arm
256+
- os: ubuntu-22.04-arm
257257
bolt: true
258258
uses: ./.github/workflows/reusable-ubuntu.yml
259259
with:

.github/workflows/jit.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ jobs:
8686
runner: ubuntu-24.04
8787
- target: aarch64-unknown-linux-gnu/gcc
8888
architecture: aarch64
89-
runner: ubuntu-24.04-arm
89+
runner: ubuntu-22.04-arm
9090
steps:
9191
- uses: actions/checkout@v4
9292
with:

.github/workflows/tail-call.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,13 @@ on:
55
- 'Python/bytecodes.c'
66
- 'Python/ceval.c'
77
- 'Python/ceval_macros.h'
8+
- 'Python/generated_cases.c.h'
89
push:
910
paths:
1011
- 'Python/bytecodes.c'
1112
- 'Python/ceval.c'
1213
- 'Python/ceval_macros.h'
14+
- 'Python/generated_cases.c.h'
1315
workflow_dispatch:
1416

1517
permissions:
@@ -62,7 +64,7 @@ jobs:
6264
runner: ubuntu-24.04
6365
- target: aarch64-unknown-linux-gnu/gcc
6466
architecture: aarch64
65-
runner: ubuntu-24.04-arm
67+
runner: ubuntu-22.04-arm
6668
steps:
6769
- uses: actions/checkout@v4
6870
with:

Doc/library/calendar.rst

Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -166,18 +166,13 @@ interpreted as prescribed by the ISO 8601 standard. Year 0 is 1 BC, year -1 is
166166
the specified width, representing an empty day. The *weekday* parameter
167167
is unused.
168168

169-
.. method:: formatweek(theweek, w=0, highlight_day=None)
169+
.. method:: formatweek(theweek, w=0)
170170

171171
Return a single week in a string with no newline. If *w* is provided, it
172172
specifies the width of the date columns, which are centered. Depends
173173
on the first weekday as specified in the constructor or set by the
174174
:meth:`setfirstweekday` method.
175175

176-
.. versionchanged:: 3.14
177-
If *highlight_day* is given, this date is highlighted in color.
178-
This can be :ref:`controlled using environment variables
179-
<using-on-controlling-color>`.
180-
181176

182177
.. method:: formatweekday(weekday, width)
183178

@@ -193,19 +188,14 @@ interpreted as prescribed by the ISO 8601 standard. Year 0 is 1 BC, year -1 is
193188
settings and are padded to the specified width.
194189

195190

196-
.. method:: formatmonth(theyear, themonth, w=0, l=0, highlight_day=None)
191+
.. method:: formatmonth(theyear, themonth, w=0, l=0)
197192

198193
Return a month's calendar in a multi-line string. If *w* is provided, it
199194
specifies the width of the date columns, which are centered. If *l* is
200195
given, it specifies the number of lines that each week will use. Depends
201196
on the first weekday as specified in the constructor or set by the
202197
:meth:`setfirstweekday` method.
203198

204-
.. versionchanged:: 3.14
205-
If *highlight_day* is given, this date is highlighted in color.
206-
This can be :ref:`controlled using environment variables
207-
<using-on-controlling-color>`.
208-
209199

210200
.. method:: formatmonthname(theyear, themonth, width=0, withyear=True)
211201

@@ -220,7 +210,7 @@ interpreted as prescribed by the ISO 8601 standard. Year 0 is 1 BC, year -1 is
220210
Print a month's calendar as returned by :meth:`formatmonth`.
221211

222212

223-
.. method:: formatyear(theyear, w=2, l=1, c=6, m=3, highlight_day=None)
213+
.. method:: formatyear(theyear, w=2, l=1, c=6, m=3)
224214

225215
Return a *m*-column calendar for an entire year as a multi-line string.
226216
Optional parameters *w*, *l*, and *c* are for date column width, lines per
@@ -229,11 +219,6 @@ interpreted as prescribed by the ISO 8601 standard. Year 0 is 1 BC, year -1 is
229219
:meth:`setfirstweekday` method. The earliest year for which a calendar
230220
can be generated is platform-dependent.
231221

232-
.. versionchanged:: 3.14
233-
If *highlight_day* is given, this date is highlighted in color.
234-
This can be :ref:`controlled using environment variables
235-
<using-on-controlling-color>`.
236-
237222

238223
.. method:: pryear(theyear, w=2, l=1, c=6, m=3)
239224

Doc/library/ctypes.rst

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1406,6 +1406,28 @@ the shared library name at development time, and hardcode that into the wrapper
14061406
module instead of using :func:`~ctypes.util.find_library` to locate the library at runtime.
14071407

14081408

1409+
.. _ctypes-listing-loaded-shared-libraries:
1410+
1411+
Listing loaded shared libraries
1412+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1413+
1414+
When writing code that relies on code loaded from shared libraries, it can be
1415+
useful to know which shared libraries have already been loaded into the current
1416+
process.
1417+
1418+
The :mod:`!ctypes.util` module provides the :func:`~ctypes.util.dllist` function,
1419+
which calls the different APIs provided by the various platforms to help determine
1420+
which shared libraries have already been loaded into the current process.
1421+
1422+
The exact output of this function will be system dependent. On most platforms,
1423+
the first entry of this list represents the current process itself, which may
1424+
be an empty string.
1425+
For example, on glibc-based Linux, the return may look like::
1426+
1427+
>>> from ctypes.util import dllist
1428+
>>> dllist()
1429+
['', 'linux-vdso.so.1', '/lib/x86_64-linux-gnu/libm.so.6', '/lib/x86_64-linux-gnu/libc.so.6', ... ]
1430+
14091431
.. _ctypes-loading-shared-libraries:
14101432

14111433
Loading shared libraries
@@ -2083,6 +2105,20 @@ Utility functions
20832105
.. availability:: Windows
20842106

20852107

2108+
.. function:: dllist()
2109+
:module: ctypes.util
2110+
2111+
Try to provide a list of paths of the shared libraries loaded into the current
2112+
process. These paths are not normalized or processed in any way. The function
2113+
can raise :exc:`OSError` if the underlying platform APIs fail.
2114+
The exact functionality is system dependent.
2115+
2116+
On most platforms, the first element of the list represents the current
2117+
executable file. It may be an empty string.
2118+
2119+
.. availability:: Windows, macOS, iOS, glibc, BSD libc, musl
2120+
.. versionadded:: next
2121+
20862122
.. function:: FormatError([code])
20872123

20882124
Returns a textual description of the error code *code*. If no error code is

Doc/library/dis.rst

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -703,15 +703,8 @@ not have to be) the original ``STACK[-2]``.
703703
STACK.append(lhs op rhs)
704704

705705
.. versionadded:: 3.11
706-
707-
708-
.. opcode:: BINARY_SUBSCR
709-
710-
Implements::
711-
712-
key = STACK.pop()
713-
container = STACK.pop()
714-
STACK.append(container[key])
706+
.. versionchanged:: 3.14
707+
With oparg :``NB_SUBSCR``, implements binary subscript (replaces opcode ``BINARY_SUBSCR``)
715708

716709

717710
.. opcode:: STORE_SUBSCR

Doc/library/enum.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -668,7 +668,7 @@ Data Types
668668
* the result is a valid *IntFlag*: an *IntFlag* is returned
669669
* the result is not a valid *IntFlag*: the result depends on the :class:`FlagBoundary` setting
670670

671-
The :func:`repr` of unnamed zero-valued flags has changed. It is now:
671+
The :func:`repr` of unnamed zero-valued flags has changed. It is now::
672672

673673
>>> Color(0)
674674
<Color: 0>

Doc/library/idle.rst

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
.. _idle:
22

3-
IDLE
4-
====
3+
IDLE --- Python editor and shell
4+
================================
55

66
.. moduleauthor:: Guido van Rossum <[email protected]>
77

@@ -12,6 +12,9 @@ IDLE
1212
single: Python Editor
1313
single: Integrated Development Environment
1414

15+
..
16+
Remember to update Lib/idlelib/help.html with idlelib.help.copy_source() when modifying this file.
17+
1518
--------------
1619

1720
IDLE is Python's Integrated Development and Learning Environment.
@@ -971,8 +974,8 @@ information. The only current default extension is zzdummy, an example
971974
also used for testing.
972975

973976

974-
idlelib
975-
-------
977+
idlelib --- implementation of IDLE application
978+
----------------------------------------------
976979

977980
.. module:: idlelib
978981
:synopsis: Implementation package for the IDLE shell/editor.

Doc/library/pathlib.rst

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1177,6 +1177,38 @@ Querying file type and status
11771177
.. versionadded:: 3.5
11781178

11791179

1180+
.. attribute:: Path.info
1181+
1182+
A :class:`~pathlib.types.PathInfo` object that supports querying file type
1183+
information. The object exposes methods that cache their results, which can
1184+
help reduce the number of system calls needed when switching on file type.
1185+
For example::
1186+
1187+
>>> p = Path('src')
1188+
>>> if p.info.is_symlink():
1189+
... print('symlink')
1190+
... elif p.info.is_dir():
1191+
... print('directory')
1192+
... elif p.info.exists():
1193+
... print('something else')
1194+
... else:
1195+
... print('not found')
1196+
...
1197+
directory
1198+
1199+
If the path was generated from :meth:`Path.iterdir` then this attribute is
1200+
initialized with some information about the file type gleaned from scanning
1201+
the parent directory. Merely accessing :attr:`Path.info` does not perform
1202+
any filesystem queries.
1203+
1204+
To fetch up-to-date information, it's best to call :meth:`Path.is_dir`,
1205+
:meth:`~Path.is_file` and :meth:`~Path.is_symlink` rather than methods of
1206+
this attribute. There is no way to reset the cache; instead you can create
1207+
a new path object with an empty info cache via ``p = Path(p)``.
1208+
1209+
.. versionadded:: 3.14
1210+
1211+
11801212
Reading and writing files
11811213
^^^^^^^^^^^^^^^^^^^^^^^^^
11821214

@@ -1903,3 +1935,56 @@ Below is a table mapping various :mod:`os` functions to their corresponding
19031935
.. [4] :func:`os.walk` always follows symlinks when categorizing paths into
19041936
*dirnames* and *filenames*, whereas :meth:`Path.walk` categorizes all
19051937
symlinks into *filenames* when *follow_symlinks* is false (the default.)
1938+
1939+
1940+
Protocols
1941+
---------
1942+
1943+
.. module:: pathlib.types
1944+
:synopsis: pathlib types for static type checking
1945+
1946+
1947+
The :mod:`pathlib.types` module provides types for static type checking.
1948+
1949+
.. versionadded:: 3.14
1950+
1951+
1952+
.. class:: PathInfo()
1953+
1954+
A :class:`typing.Protocol` describing the
1955+
:attr:`Path.info <pathlib.Path.info>` attribute. Implementations may
1956+
return cached results from their methods.
1957+
1958+
.. method:: exists(*, follow_symlinks=True)
1959+
1960+
Return ``True`` if the path is an existing file or directory, or any
1961+
other kind of file; return ``False`` if the path doesn't exist.
1962+
1963+
If *follow_symlinks* is ``False``, return ``True`` for symlinks without
1964+
checking if their targets exist.
1965+
1966+
.. method:: is_dir(*, follow_symlinks=True)
1967+
1968+
Return ``True`` if the path is a directory, or a symbolic link pointing
1969+
to a directory; return ``False`` if the path is (or points to) any other
1970+
kind of file, or if it doesn't exist.
1971+
1972+
If *follow_symlinks* is ``False``, return ``True`` only if the path
1973+
is a directory (without following symlinks); return ``False`` if the
1974+
path is any other kind of file, or if it doesn't exist.
1975+
1976+
.. method:: is_file(*, follow_symlinks=True)
1977+
1978+
Return ``True`` if the path is a file, or a symbolic link pointing to
1979+
a file; return ``False`` if the path is (or points to) a directory or
1980+
other non-file, or if it doesn't exist.
1981+
1982+
If *follow_symlinks* is ``False``, return ``True`` only if the path
1983+
is a file (without following symlinks); return ``False`` if the path
1984+
is a directory or other other non-file, or if it doesn't exist.
1985+
1986+
.. method:: is_symlink()
1987+
1988+
Return ``True`` if the path is a symbolic link (even if broken); return
1989+
``False`` if the path is a directory or any kind of file, or if it
1990+
doesn't exist.

Doc/library/pdb.rst

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -697,6 +697,17 @@ can be overridden by the local file.
697697
.. pdbcommand:: q(uit)
698698

699699
Quit from the debugger. The program being executed is aborted.
700+
An end-of-file input is equivalent to :pdbcmd:`quit`.
701+
702+
A confirmation prompt will be shown if the debugger is invoked in
703+
``'inline'`` mode. Either ``y``, ``Y``, ``<Enter>`` or ``EOF``
704+
will confirm the quit.
705+
706+
.. versionchanged:: 3.14
707+
A confirmation prompt will be shown if the debugger is invoked in
708+
``'inline'`` mode. After the confirmation, the debugger will call
709+
:func:`sys.exit` immediately, instead of raising :exc:`bdb.BdbQuit`
710+
in the next trace event.
700711

701712
.. pdbcommand:: debug code
702713

0 commit comments

Comments
 (0)