diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2012-12-29 18:57:52 (GMT) |
---|---|---|
committer | Serhiy Storchaka <storchaka@gmail.com> | 2012-12-29 18:57:52 (GMT) |
commit | e912496c6025581f8f1554c9cda92ae73f2514e5 (patch) | |
tree | 497c4a18650b2edb7069d5271074bd2fcf2550b9 /Lib/sched.py | |
parent | 6464b84b3ed28b0e66e27f180903b334151cbc70 (diff) | |
download | cpython-e912496c6025581f8f1554c9cda92ae73f2514e5.zip cpython-e912496c6025581f8f1554c9cda92ae73f2514e5.tar.gz cpython-e912496c6025581f8f1554c9cda92ae73f2514e5.tar.bz2 |
Issue #16642: Document kwargs field in sched.Event named tuple.
Diffstat (limited to 'Lib/sched.py')
-rw-r--r-- | Lib/sched.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Lib/sched.py b/Lib/sched.py index 5551f71..e523bc1 100644 --- a/Lib/sched.py +++ b/Lib/sched.py @@ -13,12 +13,12 @@ also be used to integrate scheduling with STDWIN events; the delay function is allowed to modify the queue. Time can be expressed as integers or floating point numbers, as long as it is consistent. -Events are specified by tuples (time, priority, action, argument). +Events are specified by tuples (time, priority, action, argument, kwargs). As in UNIX, lower priority numbers mean higher priority; in this way the queue can be maintained as a priority queue. Execution of the event means calling the action function, passing it the argument sequence in "argument" (remember that in Python, multiple function -arguments are be packed in a sequence). +arguments are be packed in a sequence) and keyword parameters in "kwargs". The action function may be an instance method so it has another way to reference private data (besides global variables). """ @@ -151,7 +151,7 @@ class scheduler: """An ordered list of upcoming events. Events are named tuples with fields for: - time, priority, action, arguments + time, priority, action, arguments, kwargs """ # Use heapq to sort the queue rather than using 'sorted(self._queue)'. |