lists - append - unique and sorted

rhXX rh00667 at gmail.com
Wed Jun 6 18:47:35 CEST 2007


On Jun 6, 6:35 pm, Josiah Carlson <josiah.carl... at sbcglobal.net>
wrote:
ok, tks to all for ur help and comments!!!

> Neil Cerutti wrote:
> > On 2007-06-06, rhXX <rh00... at gmail.com> wrote:
> >> and/or
>
> >> - SORTED - INSERT in the correct place using some criteria?
>
> > Consult the Python Docs about the heapq module.
>
> Heaps (as produced by heapq) are not sorted.  This will not produce
> correct results unless one then pops everything and de-dupes the output.
>
> As Diez has already said, 'use the bisect module' .
>
>   - Josiah





More information about the Python-list mailing list