Steven Bethard: > Antoon Pardon: > > For me, your class has the same drawback as the heappush, heappop > > procedurers: no way to specify a comparision function. > > Agreed. I'd love to see something like ``Heap(key=my_key_func)``.
It can be done, but the code becomes more complex and hairy: http://rafb.net/p/iCCmDz16.html (If someone spots a problem please tell me, thank you.) Bye, bearophile -- http://mail.python.org/mailman/listinfo/python-list