[docs] [issue19270] Document that sched.cancel() doesn't distinguish equal events and can break order
report at bugs.python.org
Mon Oct 21 21:43:03 CEST 2013
Serhiy Storchaka added the comment:
> 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.
Python tracker <report at bugs.python.org>
More information about the docs