Skip to content

Commit 5337c71

Browse files
Merge remote-tracking branch 'upstream/main' into allow-tier2-and-tailcall
2 parents 105ab11 + 247b50d commit 5337c71

File tree

149 files changed

+4332
-3841
lines changed

Some content is hidden

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

149 files changed

+4332
-3841
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/c-api/init.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -604,7 +604,7 @@ Process-wide parameters
604604
interpreter will change the contents of this storage.
605605
606606
Use :c:func:`Py_DecodeLocale` to decode a bytes string to get a
607-
:c:expr:`wchar_*` string.
607+
:c:expr:`wchar_t*` string.
608608
609609
.. deprecated-removed:: 3.11 3.15
610610
@@ -852,7 +852,7 @@ Process-wide parameters
852852
directory (``"."``).
853853
854854
Use :c:func:`Py_DecodeLocale` to decode a bytes string to get a
855-
:c:expr:`wchar_*` string.
855+
:c:expr:`wchar_t*` string.
856856
857857
See also :c:member:`PyConfig.orig_argv` and :c:member:`PyConfig.argv`
858858
members of the :ref:`Python Initialization Configuration <init-config>`.
@@ -888,7 +888,7 @@ Process-wide parameters
888888
:option:`-I`.
889889
890890
Use :c:func:`Py_DecodeLocale` to decode a bytes string to get a
891-
:c:expr:`wchar_*` string.
891+
:c:expr:`wchar_t*` string.
892892
893893
See also :c:member:`PyConfig.orig_argv` and :c:member:`PyConfig.argv`
894894
members of the :ref:`Python Initialization Configuration <init-config>`.
@@ -914,7 +914,7 @@ Process-wide parameters
914914
this storage.
915915
916916
Use :c:func:`Py_DecodeLocale` to decode a bytes string to get a
917-
:c:expr:`wchar_*` string.
917+
:c:expr:`wchar_t*` string.
918918
919919
.. deprecated-removed:: 3.11 3.15
920920

Doc/c-api/unicode.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1352,6 +1352,13 @@ the user settings on the machine running the codec.
13521352
in *consumed*.
13531353
13541354
1355+
.. c:function:: PyObject* PyUnicode_DecodeCodePageStateful(int code_page, const char *str, \
1356+
Py_ssize_t size, const char *errors, Py_ssize_t *consumed)
1357+
1358+
Similar to :c:func:`PyUnicode_DecodeMBCSStateful`, except uses the code page
1359+
specified by *code_page*.
1360+
1361+
13551362
.. c:function:: PyObject* PyUnicode_AsMBCSString(PyObject *unicode)
13561363
13571364
Encode a Unicode object using MBCS and return the result as Python bytes

Doc/data/refcounts.dat

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2636,6 +2636,13 @@ PyUnicode_DecodeMBCSStateful:Py_ssize_t:size::
26362636
PyUnicode_DecodeMBCSStateful:const char*:errors::
26372637
PyUnicode_DecodeMBCSStateful:Py_ssize_t*:consumed::
26382638

2639+
PyUnicode_DecodeCodePageStateful:PyObject*::+1:
2640+
PyUnicode_DecodeCodePageStateful:int:code_page::
2641+
PyUnicode_DecodeCodePageStateful:const char*:s::
2642+
PyUnicode_DecodeCodePageStateful:Py_ssize_t:size::
2643+
PyUnicode_DecodeCodePageStateful:const char*:errors::
2644+
PyUnicode_DecodeCodePageStateful:Py_ssize_t*:consumed::
2645+
26392646
PyUnicode_EncodeCodePage:PyObject*::+1:
26402647
PyUnicode_EncodeCodePage:int:code_page::
26412648
PyUnicode_EncodeCodePage:PyObject*:unicode:0:

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/dbm.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -455,7 +455,7 @@ The :mod:`!dbm.dumb` module defines the following:
455455
.. method:: dumbdbm.sync()
456456

457457
Synchronize the on-disk directory and data files. This method is called
458-
by the :meth:`Shelve.sync` method.
458+
by the :meth:`shelve.Shelf.sync` method.
459459

460460
.. method:: dumbdbm.close()
461461

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

0 commit comments

Comments
 (0)