[issue17435] threading.Timer.__init__() should use immutable argument defaults for args and kwargs

2013-03-30 Thread R. David Murray
R. David Murray added the comment: Thanks, Denver. I'm choosing not to backport it to 2.7, but that can be done later if someone finds it worth doing. -- resolution: -> fixed stage: patch review -> committed/rejected status: open -> closed versions: -Python 2.7, Python 3.2 _

[issue17435] threading.Timer.__init__() should use immutable argument defaults for args and kwargs

2013-03-30 Thread Roundup Robot
Roundup Robot added the comment: New changeset 2698920eadcd by R David Murray in branch '3.3': Issue #17435: Don't use mutable default values in Timer. http://hg.python.org/cpython/rev/2698920eadcd New changeset 8c15e57830dd by R David Murray in branch 'default': Merge #17435: Don't use mutable

[issue17435] threading.Timer.__init__() should use immutable argument defaults for args and kwargs

2013-03-27 Thread Guido van Rossum
Guido van Rossum added the comment: I agree with the OP -- it's a simple fix and the current code definitely violates our recommendations. I see no reason not to submit this (if there's nothing *else* wrong with it -- it actually seems pretty complete). Not sure how important it is to fix in

[issue17435] threading.Timer.__init__() should use immutable argument defaults for args and kwargs

2013-03-27 Thread Terry J. Reedy
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 compete

[issue17435] threading.Timer.__init__() should use immutable argument defaults for args and kwargs

2013-03-20 Thread Denver Coneybeare
Denver Coneybeare added the comment: Thanks r.david.murray. I appreciate you taking the time to look at this issue! -- ___ Python tracker ___ ___

[issue17435] threading.Timer.__init__() should use immutable argument defaults for args and kwargs

2013-03-16 Thread R. David Murray
R. David Murray added the comment: I'm sorry, you are correct. I replied too quickly without thinking it through. -- versions: +Python 2.7, Python 3.2 ___ Python tracker ___ ___

[issue17435] threading.Timer.__init__() should use immutable argument defaults for args and kwargs

2013-03-16 Thread Denver Coneybeare
Denver Coneybeare added the comment: Thanks r.david.murray for your feedback. Although I disagree with your conclusion that this does not affect 2.7. Just try running the "sample script that reproduces the issue" from my first post and you will see the erroneous behaviour in 2.7. Even thoug

[issue17435] threading.Timer.__init__() should use immutable argument defaults for args and kwargs

2013-03-15 Thread R. David Murray
R. David Murray added the comment: Hmm. This wasn't an issue before 3.3 because previously one couldn't subclass Timer. So yeah, this needs to be fixed, but only in 3.3 and tip. Thanks for the patch. -- nosy: +r.david.murray stage: -> patch review versions: -Python 2.7, Python 3.1,

[issue17435] threading.Timer.__init__() should use immutable argument defaults for args and kwargs

2013-03-15 Thread Denver Coneybeare
New submission from Denver Coneybeare: The __init__() method of threading.Timer uses *mutable* default values for the "args" and "kwargs" arguments. Since the default argument objects are created once and re-used for each instance, this means that changing the args list or kwargs dict of a Ti