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 <1382384583.15.0.0282469575897.issue19270@psf.upfronthosting.co.za>
In-reply-to
Content
> 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.
History
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: <1382384583.15.0.0282469575897.issue19270@psf.upfronthosting.co.za>
2013-10-21 19:43:03serhiy.storchakalinkissue19270 messages
2013-10-21 19:43:03serhiy.storchakacreate