安全性

核心与内置函数

Rename multiprocessing.synchronize.SemLock.is_fork_ctx to multiprocessing.synchronize.SemLock._is_fork_ctx to avoid exposing it as public API.

ast.parse() now accepts an optional argument optimize which is passed on to the compile() builtin. This makes it possible to obtain an optimized AST.

Fixes crash when tracing in recursive calls to Python classes.

The specialized instruction does the following:

  • Creates the object (by calling object._new_)

  • Pushes a shim frame to the frame stack (to cleanup after __init__)

  • Pushes the frame for __init__ to the frame stack

Speeds up the instantiation of most Python classes.

Contributed by Mateusz Nowak.

受影响的形参将在 Python 3.15 中成为仅限位置形参。

Patch by Erlend E. Aasland.

受影响的形参将在 Python 3.15 中成为仅限位置形参。

Patch by Erlend E. Aasland.

Two methods of creating NamedTuple classes with 0 fields using the functional syntax are also deprecated, and will be disallowed in Python 3.15: NT = NamedTuple("NT") and NT = NamedTuple("NT", None). To create a NamedTuple class with 0 fields, either use class NT(NamedTuple): pass or NT = NamedTuple("NT", []).

请改用 TestLoader 方法:

Patch by Hugo van Kemenade.