Terry J. Reedy added the comment:
The reported behavior is not a bug by our usual standards. The code is exactly
as documented.
manual: class threading.Timer(interval, function, args=[], kwargs={})
docstring: t = Timer(30.0, f, args=[], kwargs={})
Threading is not a beginner module. Any competent Python programmer who reads
either of the above, or the code line you quoted, would expect exactly the
behavior you report. I think we should presume that people who monkey-patch the
class, which is an unusual thing to do, know what they are doing. The patch
would break any such intentional usage. If the signature were to be changed,
there should be a deprecation period first, preferably with a
DeprecationWarning for mutation either through an instance or through .__init__.
I do not see anything special about this particular function. If we change this
use of [] and {} as defaults, then we should look at all such uses in the
stdlib -- after pydev discussion. But I currently think we should leave well
enough alone.
The Timer class was added in Sept. 2001, rev 19727, issue #428326. The patch
was written by Itamar Shtull-Trauring, approved by Guido, and reviewed and
committed by Martin.
----------
nosy: +gvanrossum, loewis, terry.reedy
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue17435>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com