Sorted List

Delaney, Timothy C (Timothy) tdelaney at avaya.com
Mon Jul 26 20:01:23 EDT 2004


Dan wrote:

> I like the sets type in python 2.4 but it has one major limitation,
> it is an unordered collection. 
> 
> I needed a container more like a list, but sorted so that searches
> are fast and ensure elements are in a specifc order. This is very
> useful for 'fuzzy logic' type searching. I could not find any
> container in Python that fits this criteria, nor could I find one in
> the vault so I created SortedList.    

Check the 'heapq' standard library module.

> What should I do with it when I'm done? Is there a place for
> Pythoniers to share code? 

Python Cookbook: http://aspn.activestate.com/ASPN/Cookbook/Python/

Tim Delaney



More information about the Python-list mailing list