@@ -9,7 +9,7 @@ from collections.abc import Callable
99from threading import Thread
1010from types import TracebackType
1111from typing import Any , Final , NoReturn , final , overload
12- from typing_extensions import TypeVarTuple , Unpack , disjoint_base
12+ from typing_extensions import TypeVarTuple , Unpack , deprecated , disjoint_base
1313
1414_Ts = TypeVarTuple ("_Ts" )
1515
@@ -119,13 +119,16 @@ if sys.version_info >= (3, 13):
119119 def locked (self ) -> bool :
120120 """Return whether the lock is in the locked state."""
121121
122- def acquire_lock (self , blocking : bool = True , timeout : float = - 1 ) -> bool :
122+ @deprecated ("Obsolete synonym. Use `acquire()` instead." )
123+ def acquire_lock (self , blocking : bool = True , timeout : float = - 1 ) -> bool : # undocumented
123124 """An obsolete synonym of acquire()."""
124125
125- def release_lock (self ) -> None :
126+ @deprecated ("Obsolete synonym. Use `release()` instead." )
127+ def release_lock (self ) -> None : # undocumented
126128 """An obsolete synonym of release()."""
127129
128- def locked_lock (self ) -> bool :
130+ @deprecated ("Obsolete synonym. Use `locked()` instead." )
131+ def locked_lock (self ) -> bool : # undocumented
129132 """An obsolete synonym of locked()."""
130133
131134 def __enter__ (self ) -> bool :
@@ -180,7 +183,8 @@ else:
180183 Return whether the lock is in the locked state.
181184 """
182185
183- def acquire_lock (self , blocking : bool = True , timeout : float = - 1 ) -> bool :
186+ @deprecated ("Obsolete synonym. Use `acquire()` instead." )
187+ def acquire_lock (self , blocking : bool = True , timeout : float = - 1 ) -> bool : # undocumented
184188 """acquire(blocking=True, timeout=-1) -> bool
185189 (acquire_lock() is an obsolete synonym)
186190
@@ -192,7 +196,8 @@ else:
192196 The blocking operation is interruptible.
193197 """
194198
195- def release_lock (self ) -> None :
199+ @deprecated ("Obsolete synonym. Use `release()` instead." )
200+ def release_lock (self ) -> None : # undocumented
196201 """release()
197202 (release_lock() is an obsolete synonym)
198203
@@ -201,7 +206,8 @@ else:
201206 but it needn't be locked by the same thread that unlocks it.
202207 """
203208
204- def locked_lock (self ) -> bool :
209+ @deprecated ("Obsolete synonym. Use `locked()` instead." )
210+ def locked_lock (self ) -> bool : # undocumented
205211 """locked() -> bool
206212 (locked_lock() is an obsolete synonym)
207213
@@ -245,14 +251,14 @@ def start_new_thread(function: Callable[[Unpack[_Ts]], object], args: tuple[Unpa
245251
246252@overload
247253def start_new_thread (function : Callable [..., object ], args : tuple [Any , ...], kwargs : dict [str , Any ], / ) -> int : ...
248-
249- # Obsolete synonym for start_new_thread()
250254@overload
251- def start_new (function : Callable [[Unpack [_Ts ]], object ], args : tuple [Unpack [_Ts ]], / ) -> int :
255+ @deprecated ("Obsolete synonym. Use `start_new_thread()` instead." )
256+ def start_new (function : Callable [[Unpack [_Ts ]], object ], args : tuple [Unpack [_Ts ]], / ) -> int : # undocumented
252257 """An obsolete synonym of start_new_thread()."""
253258
254259@overload
255- def start_new (function : Callable [..., object ], args : tuple [Any , ...], kwargs : dict [str , Any ], / ) -> int : ...
260+ @deprecated ("Obsolete synonym. Use `start_new_thread()` instead." )
261+ def start_new (function : Callable [..., object ], args : tuple [Any , ...], kwargs : dict [str , Any ], / ) -> int : ... # undocumented
256262
257263if sys .version_info >= (3 , 10 ):
258264 def interrupt_main (signum : signal .Signals = signal .SIGINT , / ) -> None :
@@ -277,15 +283,17 @@ def exit() -> NoReturn:
277283 thread to exit silently unless the exception is caught.
278284 """
279285
280- def exit_thread () -> NoReturn : # Obsolete synonym for exit()
286+ @deprecated ("Obsolete synonym. Use `exit()` instead." )
287+ def exit_thread () -> NoReturn : # undocumented
281288 """An obsolete synonym of exit()."""
282289
283290def allocate_lock () -> LockType :
284291 """Create a new lock object. See help(type(threading.Lock())) for
285292 information about locks.
286293 """
287294
288- def allocate () -> LockType : # Obsolete synonym for allocate_lock()
295+ @deprecated ("Obsolete synonym. Use `allocate_lock()` instead." )
296+ def allocate () -> LockType : # undocumented
289297 """An obsolete synonym of allocate_lock()."""
290298
291299def get_ident () -> int :
0 commit comments