diff --git a/stdlib/@tests/stubtest_allowlists/common.txt b/stdlib/@tests/stubtest_allowlists/common.txt index 5f8c42c70..1ffeeadd8 100644 --- a/stdlib/@tests/stubtest_allowlists/common.txt +++ b/stdlib/@tests/stubtest_allowlists/common.txt @@ -90,9 +90,6 @@ xml.sax.expatreader # ========== _json.encode_basestring _thread.RLock -_thread.allocate -_thread.exit_thread -_thread.start_new _threading_local._localimpl.localargs _threading_local._localimpl.locallock builtins.SyntaxError.print_file_and_line diff --git a/stdlib/_thread.pyi b/stdlib/_thread.pyi index b75e7608f..f0b70ed2a 100644 --- a/stdlib/_thread.pyi +++ b/stdlib/_thread.pyi @@ -44,6 +44,12 @@ def start_new_thread(function: Callable[[Unpack[_Ts]], object], args: tuple[Unpa @overload def start_new_thread(function: Callable[..., object], args: tuple[Any, ...], kwargs: dict[str, Any], /) -> int: ... +# Obsolete synonym for start_new_thread() +@overload +def start_new(function: Callable[[Unpack[_Ts]], object], args: tuple[Unpack[_Ts]], /) -> int: ... +@overload +def start_new(function: Callable[..., object], args: tuple[Any, ...], kwargs: dict[str, Any], /) -> int: ... + if sys.version_info >= (3, 10): def interrupt_main(signum: signal.Signals = ..., /) -> None: ... @@ -51,7 +57,9 @@ else: def interrupt_main() -> None: ... def exit() -> NoReturn: ... +def exit_thread() -> NoReturn: ... # Obsolete synonym for exit() def allocate_lock() -> LockType: ... +def allocate() -> LockType: ... # Obsolete synonym for allocate_lock() def get_ident() -> int: ... def stack_size(size: int = 0, /) -> int: ...