The old constants are preserved for backwards compatibility.

In the case where a task group is cancelled externally and also must raise an ExceptionGroup, it will now call the parent task's cancel() method. This ensures that a asyncio.CancelledError will be raised at the next await, so the cancellation is not lost.

这些更改的一个附加好处是现在任务组会保留取消操作计数 (asyncio.Task.cancelling())。

为了处理某些边界情况,现在 asyncio.Task.uncancel() 可以在取消操作计数达到零时重置未写入文档的 mustcancel 旗标。

文档

构建

Windows

macOS

IDLE

C API

Patch by Victor Stinner.

Patch by Victor Stinner.

Python 3.13.0 alpha 6

Release date: 2024-04-09

核心与内置函数

The behavior of the Tier 2 counters is changed:

  • There are no longer dynamic thresholds (we never varied these).

  • All counters now use the same exponential backoff.

  • The counter for JUMP_BACKWARD starts counting down from 16.

  • The temperature in side exits starts counting down from 64.

Reduce the number of generations from three to two. The old generation is split into two spaces, "visited" and "pending".

Collection happens in two steps:: An increment is formed from the young generation and a small part of the pending space. This increment is scanned and the survivors moved to the end of the visited space.

When the collecting space becomes empty, the two spaces are swapped.

Also in the corresponding ipaddress.IPv4Network and ipaddress.IPv6Network attributes.

threading._MainThread now always represents the main thread of the main interpreter.

PyThreadState.on_delete and PyThreadState.on_delete_data have been removed.

文档

测试

构建

Windows

C API

Python 3.13.0 alpha 5

Release date: 2024-03-12

安全性

核心与内置函数

Under wasmtime for WASI 0.2, these functions don't pass test_posix (https://github.com/bytecodealliance/wasmtime/issues/7830).

posixpath.commonpath() now raises a TypeError exception when passed None. Previously, ValueError was raised.

文档

测试

构建

Windows

macOS

IDLE

工具/示例

C API

Python 3.13.0 alpha 4

Release date: 2024-02-15