[Python-ideas] Heap data type

Terry Reedy tjreedy at udel.edu
Mon Apr 20 19:41:54 CEST 2009


Gerald Britton wrote:
> Raymond, Facundo,
> 
> May I suggest that you implement an interface similar to the sort()
> method for list objects:
> =========================
> sort([cmp[, key[, reverse]]])
> 
> "cmp specifies a custom comparison function of two arguments (list
> items) which should return a negative, zero or positive number
> depending on whether the first argument is considered smaller than,
> equal to, or larger than the second argument: cmp=lambda x,y:
> cmp(x.lower(), y.lower()). The default value is None.

Cmp(), .__cmp__, cmp=xxx, etc, are gone in Py3.

+something for the other two.





More information about the Python-ideas mailing list