|
13 | 13 | function is allowed to modify the queue. Time can be expressed as |
14 | 14 | integers or floating point numbers, as long as it is consistent. |
15 | 15 |
|
16 | | -Events are specified by tuples (time, priority, action, argument). |
| 16 | +Events are specified by tuples (time, priority, action, argument, kwargs). |
17 | 17 | As in UNIX, lower priority numbers mean higher priority; in this |
18 | 18 | way the queue can be maintained as a priority queue. Execution of the |
19 | 19 | event means calling the action function, passing it the argument |
20 | 20 | sequence in "argument" (remember that in Python, multiple function |
21 | | -arguments are be packed in a sequence). |
| 21 | +arguments are be packed in a sequence) and keyword parameters in "kwargs". |
22 | 22 | The action function may be an instance method so it |
23 | 23 | has another way to reference private data (besides global variables). |
24 | 24 | """ |
@@ -151,7 +151,7 @@ def queue(self): |
151 | 151 | """An ordered list of upcoming events. |
152 | 152 |
|
153 | 153 | Events are named tuples with fields for: |
154 | | - time, priority, action, arguments |
| 154 | + time, priority, action, arguments, kwargs |
155 | 155 |
|
156 | 156 | """ |
157 | 157 | # Use heapq to sort the queue rather than using 'sorted(self._queue)'. |
|
0 commit comments