Author serhiy.storchaka
Recipients docs@python, giampaolo.rodola, pitrou, rhettinger, serhiy.storchaka, vstinner
Date 2013-10-21.19:43:03
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
> I'm not strong on a new invariant, however I think bug #1 would deserve fixing:

How would you do this?

1. Use identity instead equality to search canceled event. It will break code where an user cancels an event by time and priority: scheduler.cancel(Event(time, priority, ...)).

2. Always cancel chronologically last (first) of equals events. This requires popp-ing and push-ing all events. Too slooooow.

3. Add an ordered number to the event. This will slow down all too.

4. Mixed strategy. First use identity search, then equality search, and only if found several equals events fallback to slow variant. This is too complicated. It will work as expected in most normal cases, but in rare cases... This behavior would hard to document and understand.

If you have better idea, patch is welcome.
Date User Action Args
2013-10-21 19:43:03serhiy.storchakasetrecipients: + serhiy.storchaka, rhettinger, pitrou, vstinner, giampaolo.rodola, docs@python
2013-10-21 19:43:03serhiy.storchakasetmessageid: <>
2013-10-21 19:43:03serhiy.storchakalinkissue19270 messages
2013-10-21 19:43:03serhiy.storchakacreate