[Patches] [ python-Patches-866594 ] heapq: A way to change the compare function

SourceForge.net noreply at sourceforge.net
Sun Dec 28 05:06:46 EST 2003


Patches item #866594, was opened at 2003-12-28 12:06
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=866594&group_id=5470

Category: Library (Lib)
Group: Python 2.3
Status: Open
Resolution: None
Priority: 5
Submitted By: Miki Tebeka (tebeka)
Assigned to: Nobody/Anonymous (nobody)
Summary: heapq: A way to change the compare function

Initial Comment:
It'd be nice if heapq could use a custom compare function.
This way the user won't need to write a class with <=
method.

I've added set_cmp(cmp=None) for setting the
comparision function. Using cmp and not expliclty <=
makes later changes in implementation easier.

Attached are the diffs.

BTW: I know in CVS heapq is a C module now, don't have
the  time to change my patch...

Miki


----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=866594&group_id=5470



More information about the Patches mailing list