Skip to content

Commit 3404bba

Browse files
authored
Merge branch 'main' into slots-pep820-mrg
2 parents 986b24e + 4599335 commit 3404bba

56 files changed

Lines changed: 2799 additions & 1477 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/documentation-links.yml

Lines changed: 0 additions & 28 deletions
This file was deleted.

.github/workflows/reusable-docs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ jobs:
5656
with:
5757
python-version: '3'
5858
cache: 'pip'
59-
cache-dependency-path: 'Doc/requirements.txt'
59+
cache-dependency-path: 'Doc/pylock.toml'
6060
- name: 'Install build dependencies'
6161
run: make -C Doc/ venv
6262

Doc/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ JOBS = auto
1313
PAPER =
1414
SOURCES =
1515
DISTVERSION = $(shell $(PYTHON) tools/extensions/patchlevel.py)
16-
REQUIREMENTS = requirements.txt
16+
REQUIREMENTS = pylock.toml
1717
SPHINXERRORHANDLING = --fail-on-warning
1818

1919
# Internal variables.

Doc/library/asyncio-task.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -394,8 +394,8 @@ Example::
394394
The ``async with`` statement will wait for all tasks in the group to finish.
395395
While waiting, new tasks may still be added to the group
396396
(for example, by passing ``tg`` into one of the coroutines
397-
and calling ``tg.create_task()`` in that coroutine). There is also opportunity
398-
to short-circuit the entire task group with ``tg.cancel()``, based on some condition.
397+
and calling ``tg.create_task()`` in that coroutine). There is also opportunity to
398+
request termination of the entire task group with ``tg.cancel()``, based on some condition.
399399
Once the last task has finished and the ``async with`` block is exited,
400400
no new tasks may be added to the group.
401401

Doc/library/functions.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1839,6 +1839,8 @@ are always available. They are listed here in alphabetical order.
18391839
Sentinel objects are truthy and compare equal only to themselves. They are
18401840
intended to be compared with the :keyword:`is` operator.
18411841

1842+
``sentinel`` does not support subclassing.
1843+
18421844
Shallow and deep copies of a sentinel object return the object itself.
18431845

18441846
Sentinels are conventionally assigned to a variable with a matching name.

Doc/library/pickletools.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,9 @@ Command-line options
7979

8080
A pickle file to read, or ``-`` to indicate reading from standard input.
8181

82+
.. versionadded:: next
83+
Output is in color by default and can be
84+
:ref:`controlled using environment variables <using-on-controlling-color>`.
8285

8386

8487
Programmatic interface

Doc/pylock.toml

Lines changed: 256 additions & 0 deletions
Large diffs are not rendered by default.

Doc/whatsnew/3.15.rst

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -678,6 +678,13 @@ Other language changes
678678
the existing support for unary minus.
679679
(Contributed by Bartosz Sławecki in :gh:`145239`.)
680680

681+
* The import system now acquires per-module locks in hierarchical order
682+
(parent packages before their submodules). This fixes a long-standing
683+
deadlock where one thread importing ``pkg.sub`` and another importing
684+
``pkg.sub.mod`` could each block the other when ``pkg/sub/__init__.py``
685+
imports ``pkg.sub.mod``.
686+
(Contributed by Gregory P. Smith in :gh:`83065`.)
687+
681688

682689
New modules
683690
===========
@@ -735,6 +742,17 @@ ast
735742
(Contributed by Stan Ulbrych in :gh:`148981`.)
736743

737744

745+
asyncio
746+
-------
747+
748+
* Added :meth:`TaskGroup.cancel <asyncio.TaskGroup.cancel>` to allow early
749+
termination of a task group, for instance, when the goal of the tasks has
750+
been achieved or their services are no longer needed.
751+
Previously this would involve unintuitive boilerplate such as an extra task
752+
raising a custom exception which is then suppressed as it exits the task group.
753+
(Contributed by John Belmonte in :gh:`127214`.)
754+
755+
738756
base64
739757
------
740758

@@ -1029,13 +1047,29 @@ os.path
10291047
(Contributed by Petr Viktorin for :cve:`2025-4517`.)
10301048

10311049

1050+
pdb
1051+
---
1052+
1053+
* Use the new interactive shell as the default input shell for :mod:`pdb`.
1054+
(Contributed by Tian Gao in :gh:`145379`.)
1055+
1056+
10321057
pickle
10331058
------
10341059

10351060
* Add support for pickling private methods and nested classes.
10361061
(Contributed by Zackery Spytz and Serhiy Storchaka in :gh:`77188`.)
10371062

10381063

1064+
pickletools
1065+
-----------
1066+
1067+
* The output of the :mod:`pickletools` command-line interface is colored by
1068+
default. This can be controlled with
1069+
:ref:`environment variables <using-on-controlling-color>`.
1070+
(Contributed by Hugo van Kemenade in :gh:`149026`.)
1071+
1072+
10391073
pprint
10401074
------
10411075

Include/internal/pycore_interp_structs.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -531,7 +531,7 @@ struct _py_func_state {
531531

532532
/* For now we hard-code this to a value for which we are confident
533533
all the static builtin types will fit (for all builds). */
534-
#define _Py_MAX_MANAGED_STATIC_BUILTIN_TYPES 202
534+
#define _Py_MAX_MANAGED_STATIC_BUILTIN_TYPES 203
535535
#define _Py_MAX_MANAGED_STATIC_EXT_TYPES 10
536536
#define _Py_MAX_MANAGED_STATIC_TYPES \
537537
(_Py_MAX_MANAGED_STATIC_BUILTIN_TYPES + _Py_MAX_MANAGED_STATIC_EXT_TYPES)

Include/internal/pycore_optimizer.h

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -534,7 +534,21 @@ typedef struct {
534534
uint8_t count;
535535
uint8_t indices[MAX_RECORDED_VALUES];
536536
} _PyOpcodeRecordEntry;
537+
538+
typedef struct {
539+
uint8_t count;
540+
uint8_t transform_mask;
541+
uint8_t slots[MAX_RECORDED_VALUES];
542+
} _PyOpcodeRecordSlotMap;
543+
537544
PyAPI_DATA(const _PyOpcodeRecordEntry) _PyOpcode_RecordEntries[256];
545+
PyAPI_DATA(const _PyOpcodeRecordSlotMap) _PyOpcode_RecordSlotMaps[256];
546+
547+
/* Convert a family-recorded value to the form a recorder uop expects.
548+
* If no transform is needed, return the input value unchanged.
549+
* Takes ownership of `value` and returns a new strong reference or NULL.
550+
*/
551+
PyAPI_FUNC(PyObject *) _PyOpcode_RecordTransformValue(int uop, PyObject *value);
538552
#endif
539553

540554
#ifdef __cplusplus

0 commit comments

Comments
 (0)