@@ -388,7 +388,16 @@ def notify_all(self):
388388 """
389389 self .notify (len (self ._waiters ))
390390
391- notifyAll = notify_all
391+ def notifyAll (self ):
392+ """Wake up all threads waiting on this condition.
393+
394+ This method is deprecated, use notify_all() instead.
395+
396+ """
397+ import warnings
398+ warnings .warn ('notifyAll() is deprecated, use notify_all() instead' ,
399+ DeprecationWarning , stacklevel = 2 )
400+ self .notify_all ()
392401
393402
394403class Semaphore :
@@ -538,7 +547,16 @@ def is_set(self):
538547 """Return true if and only if the internal flag is true."""
539548 return self ._flag
540549
541- isSet = is_set
550+ def isSet (self ):
551+ """Return true if and only if the internal flag is true.
552+
553+ This method is deprecated, use notify_all() instead.
554+
555+ """
556+ import warnings
557+ warnings .warn ('isSet() is deprecated, use is_set() instead' ,
558+ DeprecationWarning , stacklevel = 2 )
559+ return self .is_set ()
542560
543561 def set (self ):
544562 """Set the internal flag to true.
@@ -1146,15 +1164,47 @@ def daemon(self, daemonic):
11461164 self ._daemonic = daemonic
11471165
11481166 def isDaemon (self ):
1167+ """Return whether this thread is a daemon.
1168+
1169+ This method is deprecated, use the daemon attribute instead.
1170+
1171+ """
1172+ import warnings
1173+ warnings .warn ('isDaemon() is deprecated, get the daemon attribute instead' ,
1174+ DeprecationWarning , stacklevel = 2 )
11491175 return self .daemon
11501176
11511177 def setDaemon (self , daemonic ):
1178+ """Set whether this thread is a daemon.
1179+
1180+ This method is deprecated, use the .daemon property instead.
1181+
1182+ """
1183+ import warnings
1184+ warnings .warn ('setDaemon() is deprecated, set the daemon attribute instead' ,
1185+ DeprecationWarning , stacklevel = 2 )
11521186 self .daemon = daemonic
11531187
11541188 def getName (self ):
1189+ """Return a string used for identification purposes only.
1190+
1191+ This method is deprecated, use the name attribute instead.
1192+
1193+ """
1194+ import warnings
1195+ warnings .warn ('getName() is deprecated, get the name attribute instead' ,
1196+ DeprecationWarning , stacklevel = 2 )
11551197 return self .name
11561198
11571199 def setName (self , name ):
1200+ """Set the name string for this thread.
1201+
1202+ This method is deprecated, use the name attribute instead.
1203+
1204+ """
1205+ import warnings
1206+ warnings .warn ('setName() is deprecated, set the name attribute instead' ,
1207+ DeprecationWarning , stacklevel = 2 )
11581208 self .name = name
11591209
11601210
@@ -1349,7 +1399,16 @@ def current_thread():
13491399 except KeyError :
13501400 return _DummyThread ()
13511401
1352- currentThread = current_thread
1402+ def currentThread ():
1403+ """Return the current Thread object, corresponding to the caller's thread of control.
1404+
1405+ This function is deprecated, use current_thread() instead.
1406+
1407+ """
1408+ import warnings
1409+ warnings .warn ('currentThread() is deprecated, use current_thread() instead' ,
1410+ DeprecationWarning , stacklevel = 2 )
1411+ return current_thread ()
13531412
13541413def active_count ():
13551414 """Return the number of Thread objects currently alive.
@@ -1361,7 +1420,16 @@ def active_count():
13611420 with _active_limbo_lock :
13621421 return len (_active ) + len (_limbo )
13631422
1364- activeCount = active_count
1423+ def activeCount ():
1424+ """Return the number of Thread objects currently alive.
1425+
1426+ This function is deprecated, use active_count() instead.
1427+
1428+ """
1429+ import warnings
1430+ warnings .warn ('activeCount() is deprecated, use active_count() instead' ,
1431+ DeprecationWarning , stacklevel = 2 )
1432+ return active_count ()
13651433
13661434def _enumerate ():
13671435 # Same as enumerate(), but without the lock. Internal use only.
0 commit comments