Skip to content

Commit 06f86cf

Browse files
authored
Merge branch 'main' into fix-issue-128942-lockfree
2 parents 2e7132e + c492ac7 commit 06f86cf

File tree

538 files changed

+15051
-5499
lines changed

Some content is hidden

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

538 files changed

+15051
-5499
lines changed

.github/CODEOWNERS

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,12 @@ Lib/test/test_interpreters/ @ericsnowcurrently
298298
**/*-ios* @freakboy3742
299299

300300
# WebAssembly
301-
/Tools/wasm/ @brettcannon @freakboy3742
301+
Tools/wasm/config.site-wasm32-emscripten @freakboy3742
302+
/Tools/wasm/README.md @brettcannon @freakboy3742
303+
/Tools/wasm/wasi-env @brettcannon
304+
/Tools/wasm/wasi.py @brettcannon
305+
/Tools/wasm/emscripten @freakboy3742
306+
/Tools/wasm/wasi @brettcannon
302307

303308
# SBOM
304309
/Misc/externals.spdx.json @sethmlarson

.github/ISSUE_TEMPLATE/bug.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ body:
4040
- "3.12"
4141
- "3.13"
4242
- "3.14"
43+
- "3.15"
4344
- "CPython main branch"
4445
validations:
4546
required: true

.github/ISSUE_TEMPLATE/crash.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ body:
3333
- "3.12"
3434
- "3.13"
3535
- "3.14"
36+
- "3.15"
3637
- "CPython main branch"
3738
validations:
3839
required: true

.github/workflows/mypy.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,15 @@ on:
1313
- "Lib/test/libregrtest/**"
1414
- "Lib/tomllib/**"
1515
- "Misc/mypy/**"
16+
- "Tools/build/compute-changes.py"
1617
- "Tools/build/generate_sbom.py"
18+
- "Tools/build/verify_ensurepip_wheels.py"
19+
- "Tools/build/update_file.py"
1720
- "Tools/cases_generator/**"
1821
- "Tools/clinic/**"
1922
- "Tools/jit/**"
2023
- "Tools/peg_generator/**"
2124
- "Tools/requirements-dev.txt"
22-
- "Tools/wasm/**"
2325
workflow_dispatch:
2426

2527
permissions:
@@ -51,7 +53,6 @@ jobs:
5153
"Tools/clinic",
5254
"Tools/jit",
5355
"Tools/peg_generator",
54-
"Tools/wasm",
5556
]
5657
steps:
5758
- uses: actions/checkout@v4

Doc/c-api/arg.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ small to receive the value.
274274
Convert a Python integer to a C :c:expr:`unsigned long` without
275275
overflow checking.
276276

277-
.. versionchanged:: next
277+
.. versionchanged:: 3.14
278278
Use :meth:`~object.__index__` if available.
279279

280280
``L`` (:class:`int`) [long long]
@@ -284,7 +284,7 @@ small to receive the value.
284284
Convert a Python integer to a C :c:expr:`unsigned long long`
285285
without overflow checking.
286286

287-
.. versionchanged:: next
287+
.. versionchanged:: 3.14
288288
Use :meth:`~object.__index__` if available.
289289

290290
``n`` (:class:`int`) [:c:type:`Py_ssize_t`]
@@ -380,10 +380,10 @@ Other objects
380380
The *converter* for the ``O&`` format unit in *items* must not store
381381
a borrowed buffer or a borrowed reference.
382382

383-
.. versionchanged:: next
383+
.. versionchanged:: 3.14
384384
:class:`str` and :class:`bytearray` objects no longer accepted as a sequence.
385385

386-
.. deprecated:: next
386+
.. deprecated:: 3.14
387387
Non-tuple sequences are deprecated if *items* contains format units
388388
which store a borrowed buffer or a borrowed reference.
389389

@@ -396,7 +396,7 @@ Other objects
396396
If the argument is not ``None``, it is parsed according to the specified
397397
format unit.
398398

399-
.. versionadded:: next
399+
.. versionadded:: 3.14
400400

401401
A few other characters have a meaning in a format string. These may not occur
402402
inside nested parentheses. They are:

Doc/c-api/import.rst

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -16,19 +16,6 @@ Importing Modules
1616
This is a wrapper around :c:func:`PyImport_Import()` which takes a
1717
:c:expr:`const char *` as an argument instead of a :c:expr:`PyObject *`.
1818
19-
.. c:function:: PyObject* PyImport_ImportModuleNoBlock(const char *name)
20-
21-
This function is a deprecated alias of :c:func:`PyImport_ImportModule`.
22-
23-
.. versionchanged:: 3.3
24-
This function used to fail immediately when the import lock was held
25-
by another thread. In Python 3.3 though, the locking scheme switched
26-
to per-module locks for most purposes, so this function's special
27-
behaviour isn't needed anymore.
28-
29-
.. deprecated-removed:: 3.13 3.15
30-
Use :c:func:`PyImport_ImportModule` instead.
31-
3219
3320
.. c:function:: PyObject* PyImport_ImportModuleEx(const char *name, PyObject *globals, PyObject *locals, PyObject *fromlist)
3421

Doc/c-api/init_config.rst

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,7 @@ Configuration Options
363363
- Read-only
364364
* - ``"import_time"``
365365
- :c:member:`import_time <PyConfig.import_time>`
366-
- ``bool``
366+
- ``int``
367367
- Read-only
368368
* - ``"inspect"``
369369
- :c:member:`inspect <PyConfig.inspect>`
@@ -1477,13 +1477,19 @@ PyConfig
14771477
14781478
.. c:member:: int import_time
14791479
1480-
If non-zero, profile import time.
1480+
If ``1``, profile import time.
1481+
If ``2``, include additional output that indicates
1482+
when an imported module has already been loaded.
14811483
1482-
Set the ``1`` by the :option:`-X importtime <-X>` option and the
1484+
Set by the :option:`-X importtime <-X>` option and the
14831485
:envvar:`PYTHONPROFILEIMPORTTIME` environment variable.
14841486
14851487
Default: ``0``.
14861488
1489+
.. versionchanged:: 3.14
1490+
1491+
Added support for ``import_time = 2``
1492+
14871493
.. c:member:: int inspect
14881494
14891495
Enter interactive mode after executing a script or a command.

Doc/c-api/intro.rst

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -826,14 +826,17 @@ frequently used builds will be described in the remainder of this section.
826826
827827
Compiling the interpreter with the :c:macro:`!Py_DEBUG` macro defined produces
828828
what is generally meant by :ref:`a debug build of Python <debug-build>`.
829-
:c:macro:`!Py_DEBUG` is enabled in the Unix build by adding
830-
:option:`--with-pydebug` to the :file:`./configure` command.
831-
It is also implied by the presence of the
832-
not-Python-specific :c:macro:`!_DEBUG` macro. When :c:macro:`!Py_DEBUG` is enabled
833-
in the Unix build, compiler optimization is disabled.
829+
830+
On Unix, :c:macro:`!Py_DEBUG` can be enabled by adding :option:`--with-pydebug`
831+
to the :file:`./configure` command. This will also disable compiler optimization.
832+
833+
On Windows, selecting a debug build (e.g., by passing the :option:`-d` option to
834+
:file:`PCbuild/build.bat`) automatically enables :c:macro:`!Py_DEBUG`.
835+
Additionally, the presence of the not-Python-specific :c:macro:`!_DEBUG` macro,
836+
when defined by the compiler, will also implicitly enable :c:macro:`!Py_DEBUG`.
834837

835838
In addition to the reference count debugging described below, extra checks are
836-
performed, see :ref:`Python Debug Build <debug-build>`.
839+
performed. See :ref:`Python Debug Build <debug-build>` for more details.
837840

838841
Defining :c:macro:`Py_TRACE_REFS` enables reference tracing
839842
(see the :option:`configure --with-trace-refs option <--with-trace-refs>`).

Doc/c-api/object.rst

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -737,3 +737,21 @@ Object Protocol
737737
caller must hold a :term:`strong reference` to *obj* when calling this.
738738
739739
.. versionadded:: 3.14
740+
741+
.. c:function:: int PyUnstable_Object_IsUniquelyReferenced(PyObject *op)
742+
743+
Determine if *op* only has one reference.
744+
745+
On GIL-enabled builds, this function is equivalent to
746+
:c:expr:`Py_REFCNT(op) == 1`.
747+
748+
On a :term:`free threaded <free threading>` build, this checks if *op*'s
749+
:term:`reference count` is equal to one and additionally checks if *op*
750+
is only used by this thread. :c:expr:`Py_REFCNT(op) == 1` is **not**
751+
thread-safe on free threaded builds; prefer this function.
752+
753+
The caller must hold an :term:`attached thread state`, despite the fact
754+
that this function doesn't call into the Python interpreter. This function
755+
cannot fail.
756+
757+
.. versionadded:: 3.14

Doc/c-api/refcounting.rst

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,14 @@ of Python objects.
2323
2424
Use the :c:func:`Py_SET_REFCNT()` function to set an object reference count.
2525
26-
See also the function :c:func:`PyUnstable_Object_IsUniqueReferencedTemporary()`.
26+
.. note::
27+
28+
On :term:`free threaded <free threading>` builds of Python, returning 1
29+
isn't sufficient to determine if it's safe to treat *o* as having no
30+
access by other threads. Use :c:func:`PyUnstable_Object_IsUniquelyReferenced`
31+
for that instead.
32+
33+
See also the function :c:func:`PyUnstable_Object_IsUniqueReferencedTemporary()`.
2734
2835
.. versionchanged:: 3.10
2936
:c:func:`Py_REFCNT()` is changed to the inline static function.

0 commit comments

Comments
 (0)