mirror of
https://github.com/python/cpython.git
synced 2025-07-07 19:35:27 +00:00
Issue #16642: Document kwargs field in sched.Event named tuple.
This commit is contained in:
parent
6464b84b3e
commit
e912496c60
2 changed files with 5 additions and 4 deletions
|
@ -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)'.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue