threading updates for 3.14 (#14032)

This commit is contained in:
Max Muoto
2025-05-12 18:17:26 -05:00
committed by GitHub
parent e224b28f32
commit a32af68fad
2 changed files with 28 additions and 12 deletions
@@ -141,8 +141,6 @@ string.templatelib
sys.is_remote_debug_enabled
sys.remote_exec
tarfile.TarFile.zstopen
threading.Thread.__init__
threading._RLock.locked
tkinter.Event.__class_getitem__
turtle.__all__
turtle.RawTurtle.fill
+28 -10
View File
@@ -3,6 +3,7 @@ import sys
from _thread import _excepthook, _ExceptHookArgs, get_native_id as get_native_id
from _typeshed import ProfileFunction, TraceFunction
from collections.abc import Callable, Iterable, Mapping
from contextvars import ContextVar
from types import TracebackType
from typing import Any, TypeVar, final
from typing_extensions import deprecated
@@ -76,16 +77,30 @@ class Thread:
@property
def ident(self) -> int | None: ...
daemon: bool
def __init__(
self,
group: None = None,
target: Callable[..., object] | None = None,
name: str | None = None,
args: Iterable[Any] = (),
kwargs: Mapping[str, Any] | None = None,
*,
daemon: bool | None = None,
) -> None: ...
if sys.version_info >= (3, 14):
def __init__(
self,
group: None = None,
target: Callable[..., object] | None = None,
name: str | None = None,
args: Iterable[Any] = (),
kwargs: Mapping[str, Any] | None = None,
*,
daemon: bool | None = None,
context: ContextVar[Any] | None = None,
) -> None: ...
else:
def __init__(
self,
group: None = None,
target: Callable[..., object] | None = None,
name: str | None = None,
args: Iterable[Any] = (),
kwargs: Mapping[str, Any] | None = None,
*,
daemon: bool | None = None,
) -> None: ...
def start(self) -> None: ...
def run(self) -> None: ...
def join(self, timeout: float | None = None) -> None: ...
@@ -116,6 +131,9 @@ class _RLock:
__enter__ = acquire
def __exit__(self, t: type[BaseException] | None, v: BaseException | None, tb: TracebackType | None) -> None: ...
if sys.version_info >= (3, 14):
def locked(self) -> bool: ...
RLock = _thread.RLock # Actually a function at runtime.
class Condition: