Author rhettinger
Recipients giampaolo.rodola, pitrou, rhettinger, serhiy.storchaka
Date 2013-10-21.05:12:14
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
> 1. sched.cancel() can remove wrong event
> (because it uses equality instead identity).

I don't think this is a bug.  The user should be able to define events that can be compared on equality.  It is the user's responsibility to make sure that events are distinct (this is no different than how list.remove() works for example).

> 2. sched.cancel() change order of equal (by time and priority) events.

That is allowed.   We make no stability guarantees.  Plus it just makes sense that events with the same time and priority are non-deterministic.

Note, to add stability we would have to store the order that events were added.  This would slow down the code.

Add note that Tornado uses heapq in its ioloop in the same way that the schedule module does.  It too makes no effort to preserve input order.

I recommend closing this as "not a bug" or as an "further document the existing behaviors".
Date User Action Args
2013-10-21 05:12:14rhettingersetrecipients: + rhettinger, pitrou, giampaolo.rodola, serhiy.storchaka
2013-10-21 05:12:14rhettingersetmessageid: <>
2013-10-21 05:12:14rhettingerlinkissue19270 messages
2013-10-21 05:12:14rhettingercreate