Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Doc/library/asyncio-task.rst
Original file line number Diff line number Diff line change
Expand Up @@ -394,8 +394,8 @@ Example::
The ``async with`` statement will wait for all tasks in the group to finish.
While waiting, new tasks may still be added to the group
(for example, by passing ``tg`` into one of the coroutines
and calling ``tg.create_task()`` in that coroutine). There is also opportunity
to short-circuit the entire task group with ``tg.cancel()``, based on some condition.
and calling ``tg.create_task()`` in that coroutine). There is also opportunity to
request termination of the entire task group with ``tg.cancel()``, based on some condition.
Once the last task has finished and the ``async with`` block is exited,
no new tasks may be added to the group.

Expand Down
11 changes: 11 additions & 0 deletions Doc/whatsnew/3.15.rst
Original file line number Diff line number Diff line change
Expand Up @@ -741,6 +741,17 @@ ast
(Contributed by Stan Ulbrych in :gh:`148981`.)


asyncio
-------

* Added :meth:`TaskGroup.cancel <asyncio.TaskGroup.cancel>` to allow early
termination of a task group, for instance, when the goal of the tasks has
been achieved or their services are no longer needed.
Previously this would involve unintuitive boilerplate such as an extra task
raising a custom exception which is then suppressed as it exits the task group.
(Contributed by John Belmonte in :gh:`127214`.)


base64
------

Expand Down
14 changes: 14 additions & 0 deletions Include/internal/pycore_optimizer.h
Original file line number Diff line number Diff line change
Expand Up @@ -534,7 +534,21 @@ typedef struct {
uint8_t count;
uint8_t indices[MAX_RECORDED_VALUES];
} _PyOpcodeRecordEntry;

typedef struct {
uint8_t count;
uint8_t transform_mask;
uint8_t slots[MAX_RECORDED_VALUES];
} _PyOpcodeRecordSlotMap;

PyAPI_DATA(const _PyOpcodeRecordEntry) _PyOpcode_RecordEntries[256];
PyAPI_DATA(const _PyOpcodeRecordSlotMap) _PyOpcode_RecordSlotMaps[256];

/* Convert a family-recorded value to the form a recorder uop expects.
* If no transform is needed, return the input value unchanged.
* Takes ownership of `value` and returns a new strong reference or NULL.
*/
PyAPI_FUNC(PyObject *) _PyOpcode_RecordTransformValue(int uop, PyObject *value);
#endif

#ifdef __cplusplus
Expand Down
Loading
Loading