Skip to content

Commit c9ff412

Browse files
committed
resolve conflict with main
2 parents f8e657f + 5dbe2ac commit c9ff412

237 files changed

Lines changed: 8826 additions & 2091 deletions

File tree

Some content is hidden

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

‎.github/workflows/build.yml‎

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -167,14 +167,12 @@ jobs:
167167
- true
168168
interpreter:
169169
- switch-case
170+
- tail-call
170171
exclude:
171172
# Skip Win32 on free-threaded builds
172173
- { arch: Win32, free-threading: true }
173-
include:
174-
# msvc::musttail is currently only supported on x64,
175-
# and only supported on 3.15+.
176-
- { arch: x64, free-threading: false, interpreter: tail-call }
177-
- { arch: x64, free-threading: true, interpreter: tail-call }
174+
# Skip Win32 on tail-call interpreter builds
175+
- { arch: Win32, interpreter: tail-call }
178176
uses: $/.github/workflows/reusable-windows.yml
179177
with:
180178
arch: ${{ matrix.arch }}
@@ -549,9 +547,17 @@ jobs:
549547
run: |
550548
"$BUILD_DIR/host-python/bin/python3" -m test test_sysconfig test_site test_embed
551549
- name: Configure cross build
552-
run: ./configure --prefix="$BUILD_DIR/cross-python" --with-build-python="$BUILD_DIR/host-python/bin/python3"
550+
run: |
551+
# Exercise a native build whose builtin modules differ from the build Python.
552+
echo '_bisect _bisectmodule.c' > Modules/Setup.local
553+
./configure --prefix="$BUILD_DIR/cross-python" --with-build-python="$BUILD_DIR/host-python/bin/python3"
553554
- name: Install cross Python
554555
run: make -j8 install
556+
- name: Check native extension modules with a build Python
557+
run: |
558+
"$BUILD_DIR/host-python/bin/python3" -c "import sys; assert '_bisect' not in sys.builtin_module_names"
559+
"$BUILD_DIR/cross-python/bin/python3" -c "import _bisect, sys; assert '_bisect' in sys.builtin_module_names"
560+
PYTHONSTRICTEXTENSIONBUILD=1 make checksharedmods
555561
- name: Display build info
556562
run: |
557563
"$BUILD_DIR/cross-python/bin/python3" -m test.pythoninfo

‎Doc/c-api/gcsupport.rst‎

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,13 @@ The :c:member:`~PyTypeObject.tp_traverse` handler must have the following type:
253253
returned immediately.
254254
Otherwise, return zero.
255255
256+
The garbage collector can call :c:member:`~PyTypeObject.tp_traverse` more
257+
than once for the same object during a collection. If the object's
258+
references do not change, each traversal must visit the same references.
259+
In particular, do not skip a reference because a lock is busy.
260+
If one traversal visits a reference and a later traversal skips it, the
261+
collector can clear an object that is still reachable.
262+
256263
A typical :c:member:`!tp_traverse` function calls the :c:func:`Py_VISIT`
257264
convenience macro on each of the instance's members that are Python
258265
objects that the instance owns.
@@ -318,14 +325,6 @@ The :c:member:`~PyTypeObject.tp_traverse` handler must have the following type:
318325
For a list of safe functions, see a
319326
:ref:`separate section <duringgc-functions>` below.
320327
321-
If an error occurs during traversal, ignore it and return 0.
322-
If ``tp_traverse`` fails to visit some strong references, garbage reference
323-
cycles involving the skipped references will not be reliably broken,
324-
but correctness won't be affected.
325-
For example, if traversal requires a lock that cannot be acquired promptly,
326-
skip the traversal.
327-
The garbage collector will visit your object again in a future pass.
328-
329328
.. note::
330329
331330
The :c:func:`Py_VISIT` call may be skipped for those members that provably

‎Doc/library/curses.rst‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1032,10 +1032,15 @@ Terminfo database
10321032
Instantiate the bytes object *str* with the supplied parameters, where *str* should
10331033
be a parameterized byte string obtained from the terminfo database. For example,
10341034
``tparm(tigetstr("cup"), 5, 3)`` could result in ``b'\033[6;4H'``, the exact
1035-
result depending on terminal type. Up to nine integer parameters may be supplied.
1035+
result depending on terminal type. Up to nine parameters may be supplied.
1036+
They are integers, except in a few cases, such as ``Ms`` of xterm,
1037+
where they must be bytes objects.
10361038

10371039
:func:`setupterm` (or :func:`initscr`) must be called first.
10381040

1041+
.. versionchanged:: next
1042+
Added support of bytes parameters.
1043+
10391044
.. function:: putp(str)
10401045

10411046
Equivalent to ``tputs(str, 1, putchar)``; emit the value of a specified

‎Doc/library/decimal.rst‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1777,6 +1777,8 @@ condition.
17771777
0 ** 0
17781778
x ** (non-integer)
17791779
x ** Infinity
1780+
NaN >= 0
1781+
NaN < 0
17801782

17811783

17821784
.. class:: Overflow
@@ -1906,6 +1908,8 @@ expanding the precision sufficiently to avoid loss of significance:
19061908
Decimal('0.0060000')
19071909

19081910

1911+
.. _decimal-notes-specials:
1912+
19091913
Special values
19101914
^^^^^^^^^^^^^^
19111915

‎Doc/library/fnmatch.rst‎

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,10 @@ module. See module :mod:`glob` for pathname expansion (:mod:`glob` uses
4646
a period are not special for this module, and are matched by the ``*`` and ``?``
4747
patterns.
4848

49-
Unless stated otherwise, "filename string" and "pattern string" either refer to
50-
:class:`str` or ``ISO-8859-1`` encoded :class:`bytes` objects. Note that the
49+
Unless stated otherwise, "filename string" and "pattern string" refer to
50+
:class:`str` or ``ISO-8859-1`` encoded :class:`bytes` objects.
51+
In addition to filename strings, :func:`.filter` and :func:`.filterfalse`
52+
accept :term:`path-like objects <path-like object>` in *names*. Note that the
5153
functions documented below do not allow to mix a :class:`!bytes` pattern with
5254
a :class:`!str` filename, and vice-versa.
5355

@@ -90,6 +92,9 @@ functions: :func:`~fnmatch.fnmatch`, :func:`fnmatchcase`, :func:`.filter`,
9092
It is the same as ``[n for n in names if fnmatch(n, pat)]``,
9193
but implemented more efficiently.
9294

95+
.. versionchanged:: next
96+
Added support for path-like objects in *names*.
97+
9398

9499
.. function:: filterfalse(names, pat)
95100

@@ -100,6 +105,9 @@ functions: :func:`~fnmatch.fnmatch`, :func:`fnmatchcase`, :func:`.filter`,
100105

101106
.. versionadded:: 3.14
102107

108+
.. versionchanged:: next
109+
Added support for path-like objects in *names*.
110+
103111

104112
.. function:: translate(pat)
105113

‎Doc/library/http.rst‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ The :mod:`!http` module also defines the following enums that help you work with
3535

3636
>>> from http import HTTPStatus
3737
>>> HTTPStatus.OK
38-
HTTPStatus.OK
38+
<HTTPStatus.OK: 200>
3939
>>> HTTPStatus.OK == 200
4040
True
4141
>>> HTTPStatus.OK.value
@@ -45,7 +45,7 @@ The :mod:`!http` module also defines the following enums that help you work with
4545
>>> HTTPStatus.OK.description
4646
'Request fulfilled, document follows'
4747
>>> list(HTTPStatus)
48-
[HTTPStatus.CONTINUE, HTTPStatus.SWITCHING_PROTOCOLS, ...]
48+
[<HTTPStatus.CONTINUE: 100>, <HTTPStatus.SWITCHING_PROTOCOLS: 101>, ...]
4949

5050
.. _http-status-codes:
5151

‎Doc/library/logging.rst‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -919,7 +919,7 @@ wire).
919919
:param exc_info: An exception tuple with the current exception information,
920920
as returned by :func:`sys.exc_info`,
921921
or ``None`` if no exception information is available.
922-
:type exc_info: tuple[type[BaseException], BaseException, types.TracebackType] | None
922+
:type exc_info: tuple[type[BaseException], BaseException, types.TracebackType | None] | tuple[None, None, None] | None
923923

924924
:param func: The name of the function or method
925925
from which the logging call was invoked.

‎Doc/library/platform.rst‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -325,7 +325,7 @@ Android platform
325325

326326
* ``release`` - Android version, as a string (e.g. ``"14"``).
327327

328-
* ``api_level`` - API level of the running device, as an integer (e.g. ``34``
328+
* ``api_level`` - Major component of the API level, as an integer (e.g. ``34``
329329
for Android 14). To get the API level which Python was built against, see
330330
:func:`sys.getandroidapilevel`.
331331

‎Doc/library/profiling.sampling.rst‎

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1321,11 +1321,14 @@ data, similar to the ``top`` command for system processes::
13211321

13221322
.. only:: not latex
13231323

1324-
.. figure:: tachyon-live-mode-2.gif
1324+
.. figure:: tachyon-live-mode-2.svg
13251325
:alt: Tachyon live mode showing all threads
13261326
:align: center
13271327
:width: 100%
13281328

1329+
.. This screenshot has been rendered with this one-liner CLI:
1330+
uvx 'click-extra==10.3.1' screenshot --record --columns 120 --rows 47 --start 6 --end 10 --hold 0 --blank 0 --preset plain --prompt '' --watermark '' --margin 0 --padding 0 --shadow none --border none --output tachyon-live-mode-2.svg -- python3.15 -m profiling.sampling run --live --all-threads --sampling-rate 10khz -m test test_gc test_threading test_list test_dict
1331+
13291332
Live mode displays real-time profiling statistics, showing combined
13301333
data from multiple threads in a multi-threaded application.
13311334

@@ -1346,11 +1349,14 @@ frequently, including specialized variants and their base opcodes.
13461349

13471350
.. only:: not latex
13481351

1349-
.. figure:: tachyon-live-mode-1.gif
1352+
.. figure:: tachyon-live-mode-1.svg
13501353
:alt: Tachyon live mode with opcode panel
13511354
:align: center
13521355
:width: 100%
13531356

1357+
.. This screenshot has been rendered with this one-liner CLI:
1358+
uvx 'click-extra==10.3.1' screenshot --record --columns 120 --rows 47 --start 6 --end 10 --hold 0 --blank 0 --preset plain --prompt '' --watermark '' --margin 0 --padding 0 --shadow none --border none --output tachyon-live-mode-1.svg -- python3.15 -m profiling.sampling run --live --all-threads --sampling-rate 10khz --opcodes -m test test_gc test_threading test_list test_dict
1359+
13541360
Live mode with ``--opcodes`` enabled shows an opcode panel with a bytecode
13551361
instruction breakdown for the selected function.
13561362

‎Doc/library/runpy.rst‎

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -114,10 +114,9 @@ The :mod:`!runpy` module provides two functions:
114114
For a simple script, the specified code is simply executed in a fresh
115115
module namespace. For a valid :data:`sys.path` entry (typically a zipfile or
116116
directory), the entry is first added to the beginning of ``sys.path``. The
117-
function then looks for and executes a :mod:`__main__` module using the
118-
updated path. Note that there is no special protection against invoking
119-
an existing ``__main__`` entry located elsewhere on ``sys.path`` if
120-
there is no such module at the specified location.
117+
function then looks for and executes a :mod:`__main__` module in that
118+
entry. :exc:`ImportError` is raised if there is no such module at the
119+
specified location.
121120

122121
The optional dictionary argument *init_globals* may be used to pre-populate
123122
the module's globals dictionary before the code is executed.
@@ -177,6 +176,9 @@ The :mod:`!runpy` module provides two functions:
177176
.. versionchanged:: 3.15
178177
The global variable ``__cached__`` is no longer set.
179178

179+
.. versionchanged:: next
180+
The ``__main__`` module is now searched only in *path_name*.
181+
180182
.. seealso::
181183

182184
:pep:`338` -- Executing modules as scripts

0 commit comments

Comments
 (0)