@@ -5,6 +5,7 @@ from _typeshed import ProfileFunction, TraceFunction
55from collections .abc import Callable , Iterable , Mapping
66from types import TracebackType
77from typing import Any , TypeVar , final
8+ from typing_extensions import deprecated
89
910_T = TypeVar ("_T" )
1011
@@ -44,9 +45,11 @@ if sys.version_info >= (3, 12):
4445_profile_hook : ProfileFunction | None
4546
4647def active_count () -> int : ...
47- def activeCount () -> int : ... # deprecated alias for active_count()
48+ @deprecated ("Use active_count() instead" )
49+ def activeCount () -> int : ...
4850def current_thread () -> Thread : ...
49- def currentThread () -> Thread : ... # deprecated alias for current_thread()
51+ @deprecated ("Use current_thread() instead" )
52+ def currentThread () -> Thread : ...
5053def get_ident () -> int : ...
5154def enumerate () -> list [Thread ]: ...
5255def main_thread () -> Thread : ...
@@ -89,11 +92,14 @@ class Thread:
8992 @property
9093 def native_id (self ) -> int | None : ... # only available on some platforms
9194 def is_alive (self ) -> bool : ...
92- # the following methods are all deprecated
93- def getName (self ) -> str : ...
94- def setName (self , name : str ) -> None : ...
95+ @deprecated ("Get the daemon attribute instead" )
9596 def isDaemon (self ) -> bool : ...
97+ @deprecated ("Set the daemon attribute instead" )
9698 def setDaemon (self , daemonic : bool ) -> None : ...
99+ @deprecated ("Use the name attribute instead" )
100+ def getName (self ) -> str : ...
101+ @deprecated ("Use the name attribute instead" )
102+ def setName (self , name : str ) -> None : ...
97103
98104class _DummyThread (Thread ):
99105 def __init__ (self ) -> None : ...
@@ -124,7 +130,8 @@ class Condition:
124130 def wait_for (self , predicate : Callable [[], _T ], timeout : float | None = None ) -> _T : ...
125131 def notify (self , n : int = 1 ) -> None : ...
126132 def notify_all (self ) -> None : ...
127- def notifyAll (self ) -> None : ... # deprecated alias for notify_all()
133+ @deprecated ("Use notify_all() instead" )
134+ def notifyAll (self ) -> None : ...
128135
129136class Semaphore :
130137 _value : int
@@ -138,7 +145,8 @@ class BoundedSemaphore(Semaphore): ...
138145
139146class Event :
140147 def is_set (self ) -> bool : ...
141- def isSet (self ) -> bool : ... # deprecated alias for is_set()
148+ @deprecated ("Use is_set() instead" )
149+ def isSet (self ) -> bool : ...
142150 def set (self ) -> None : ...
143151 def clear (self ) -> None : ...
144152 def wait (self , timeout : float | None = None ) -> bool : ...
0 commit comments