Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

bpo-29569: threading.Timer class: Continue periodical execution till action return True #121

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 6 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix docs
  • Loading branch information
slytomcat committed Feb 16, 2017
commit e25ab6af0e2aa56cb189ebb19e9c7199f8a96559
12 changes: 5 additions & 7 deletions 12 Doc/library/threading.rst
Original file line number Diff line number Diff line change
Expand Up @@ -832,17 +832,17 @@ Timer Objects
-------------

This class represents an action that should be run after a certain amount
of time has passed --- a timer. It also can run periodically: each run happens
after specified time that passed since previous run until the action returns True.
:class:`Timer` is a subclass of :class:`Thread`
of time has passed --- a timer. It also can run periodically. Each run takes
place after a specified time after the previous run. This continues until
the action returns TRUE. :class:`Timer` is a subclass of :class:`Thread`
and as such also functions as an example of creating custom threads.

Timers are started, as with threads, by calling their :meth:`~Timer.start`
method. The timer can be stopped (before its action has begun) by calling the
:meth:`~Timer.cancel` method. If action has returned True then next run is
scheduled after the timer interval. The interval the timer will wait before
executing its action may not be exactly the same as the interval specified
by the user.
by the user.


For example::
Expand All @@ -858,14 +858,12 @@ For example::
t = Timer(1.0, star)
t.start() # it prints five "*" with 1 sec waiting between prints




.. 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 and continues
periodically run *function* until *function* returns True.
periodically run *function* till *function* returns True.
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.

Expand Down
Morty Proxy This is a proxified and sanitized view of the page, visit original site.