[Python-checkins] cpython (3.3): Issue #16642: Document kwargs field in sched.Event named tuple.
serhiy.storchaka
python-checkins at python.org
Sat Dec 29 20:00:48 CET 2012
http://hg.python.org/cpython/rev/5db0833f135b
changeset: 81132:5db0833f135b
branch: 3.3
parent: 81130:e0761560d844
user: Serhiy Storchaka <storchaka at gmail.com>
date: Sat Dec 29 20:57:52 2012 +0200
summary:
Issue #16642: Document kwargs field in sched.Event named tuple.
files:
Doc/library/sched.rst | 3 ++-
Lib/sched.py | 6 +++---
2 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/Doc/library/sched.rst b/Doc/library/sched.rst
--- a/Doc/library/sched.rst
+++ b/Doc/library/sched.rst
@@ -27,6 +27,7 @@
.. versionchanged:: 3.3
*timefunc* and *delayfunc* parameters are optional.
+
.. versionchanged:: 3.3
:class:`scheduler` class can be safely used in multi-threaded
environments.
@@ -129,4 +130,4 @@
Read-only attribute returning a list of upcoming events in the order they
will be run. Each event is shown as a :term:`named tuple` with the
- following fields: time, priority, action, argument.
+ following fields: time, priority, action, argument, kwargs.
diff --git a/Lib/sched.py b/Lib/sched.py
--- a/Lib/sched.py
+++ b/Lib/sched.py
@@ -13,12 +13,12 @@
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 @@
"""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)'.
--
Repository URL: http://hg.python.org/cpython
More information about the Python-checkins
mailing list