summaryrefslogtreecommitdiff
path: root/Lib/threading.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/threading.py')
-rw-r--r--Lib/threading.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/Lib/threading.py b/Lib/threading.py
index 6c34d49782..46df676f24 100644
--- a/Lib/threading.py
+++ b/Lib/threading.py
@@ -802,17 +802,17 @@ class Thread:
class Timer(Thread):
"""Call a function after a specified number of seconds:
- t = Timer(30.0, f, args=[], kwargs={})
+ t = Timer(30.0, f, args=None, kwargs=None)
t.start()
t.cancel() # stop the timer's action if it's still waiting
"""
- def __init__(self, interval, function, args=[], kwargs={}):
+ def __init__(self, interval, function, args=None, kwargs=None):
Thread.__init__(self)
self.interval = interval
self.function = function
- self.args = args
- self.kwargs = kwargs
+ self.args = args if args is not None else []
+ self.kwargs = kwargs if kwargs is not None else {}
self.finished = Event()
def cancel(self):