
Jan. 13, 2004
8:06 p.m.
"Raymond Hettinger" <raymond.hettinger@verizon.net> writes:
nlargest(iterable, n=1) nsmallest(iterable, n=1) [...] Note, heapq is used for both (I use operator.neg to swap between largest and smallest).
Does that mean nlargest/nsmallest only work for numbers? I think it might be useful for e.g. strings too. Bernhard -- Intevation GmbH http://intevation.de/ Sketch http://sketch.sourceforge.net/ Thuban http://thuban.intevation.org/