[New-bugs-announce] [issue4781] The function, Threading.Timer.run(), may be Inappropriate

Deli.Zhang report at bugs.python.org
Tue Dec 30 16:44:01 CET 2008


New submission from Deli.Zhang <gestapo21th at 163.com>:

def run(self):
        self.finished.wait(self.interval)
        if not self.finished.isSet():
            self.function(*self.args, **self.kwargs)
        self.finished.set()

I think the function run() should be modified to like this below:

def run(self):
        while not self.finished.isSet():
            self.finished.wait(self.interval)
            self.function(*self.args, **self.kwargs)

In this case, it can still run on next 'interval', and next's next...

----------
components: Library (Lib)
messages: 78540
nosy: gestapo21th
severity: normal
status: open
title: The function, Threading.Timer.run(), may be Inappropriate
type: feature request
versions: Python 3.1

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue4781>
_______________________________________


More information about the New-bugs-announce mailing list