diff options
author | R David Murray <rdmurray@bitdance.com> | 2013-03-30 21:19:38 (GMT) |
---|---|---|
committer | R David Murray <rdmurray@bitdance.com> | 2013-03-30 21:19:38 (GMT) |
commit | 19aeb439c6ca0da540ad95eec599d3654babe20b (patch) | |
tree | 1c074a911bbd6f8b6e652ca100add42fc0d7afe6 /Doc/library | |
parent | 8028a5cf15753c283b7308a32ecc4651db33c6c9 (diff) | |
download | cpython-19aeb439c6ca0da540ad95eec599d3654babe20b.zip cpython-19aeb439c6ca0da540ad95eec599d3654babe20b.tar.gz cpython-19aeb439c6ca0da540ad95eec599d3654babe20b.tar.bz2 |
Issue #17435: Don't use mutable default values in Timer.
Patch by Denver Coneybeare with some test modifications by me.
Diffstat (limited to 'Doc/library')
-rw-r--r-- | Doc/library/threading.rst | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/Doc/library/threading.rst b/Doc/library/threading.rst index f697cbb..1bcf0a2 100644 --- a/Doc/library/threading.rst +++ b/Doc/library/threading.rst @@ -839,10 +839,12 @@ For example:: t.start() # after 30 seconds, "hello, world" will be printed -.. class:: Timer(interval, function, args=[], kwargs={}) +.. class:: Timer(interval, function, args=None, kwargs=None) Create a timer that will run *function* with arguments *args* and keyword arguments *kwargs*, after *interval* seconds have passed. + If *args* is None (the default) then an empty list will be used. + If *kwargs* is None (the default) then an empty dict will be used. .. versionchanged:: 3.3 changed from a factory function to a class. |