[Python-Dev] Accumulation module

Bernhard Herzog bh at intevation.de
Tue Jan 13 15:06:54 EST 2004


"Raymond Hettinger" <raymond.hettinger at 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/



More information about the Python-Dev mailing list