summaryrefslogtreecommitdiffstats
path: root/Lib/sched.py
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2011-11-23 01:06:23 (GMT)
committerBenjamin Peterson <benjamin@python.org>2011-11-23 01:06:23 (GMT)
commite0bcca510ad2af33d1d62a922d8c3d36400f8bcf (patch)
tree4d577fb2f93ced57725a64333d4b5fee040979a3 /Lib/sched.py
parent5944c369314a4e57e997eb855f45ccde96e37db7 (diff)
parentbc530324086fceab771e9ec5596d572fe452215e (diff)
downloadcpython-e0bcca510ad2af33d1d62a922d8c3d36400f8bcf.zip
cpython-e0bcca510ad2af33d1d62a922d8c3d36400f8bcf.tar.gz
cpython-e0bcca510ad2af33d1d62a922d8c3d36400f8bcf.tar.bz2
merge heads
Diffstat (limited to 'Lib/sched.py')
-rw-r--r--Lib/sched.py8
1 files changed, 0 insertions, 8 deletions
diff --git a/Lib/sched.py b/Lib/sched.py
index 3e41198..6c01e69 100644
--- a/Lib/sched.py
+++ b/Lib/sched.py
@@ -35,9 +35,6 @@ from collections import namedtuple
__all__ = ["scheduler"]
class Event(namedtuple('Event', 'time, priority, action, argument, kwargs')):
- def __init__(self, *args, **kwargs):
- super(Event, self).__init__(*args, **kwargs)
- self._scheduled = False
def __eq__(s, o): return (s.time, s.priority) == (o.time, o.priority)
def __ne__(s, o): return (s.time, s.priority) != (o.time, o.priority)
def __lt__(s, o): return (s.time, s.priority) < (o.time, o.priority)
@@ -62,7 +59,6 @@ class scheduler:
"""
event = Event(time, priority, action, argument, kwargs)
- event._scheduled = True
heapq.heappush(self._queue, event)
return event # The ID
@@ -85,9 +81,6 @@ class scheduler:
self._queue.remove(event)
heapq.heapify(self._queue)
- def is_scheduled(self, event):
- return event._scheduled
-
def empty(self):
"""Check whether the queue is empty."""
return not self._queue
@@ -129,7 +122,6 @@ class scheduler:
# Verify that the event was not removed or altered
# by another thread after we last looked at q[0].
if event is checked_event:
- event._scheduled = False
action(*argument, **kwargs)
delayfunc(0) # Let other threads run
else: