Sorted List

Raaijmakers, Vincent (GE Infrastructure) Vincent.Raaijmakers at ge.com
Mon Jul 26 20:02:17 CEST 2004


Perhaps the online Python Cookbook is a good start.
 
http://aspn.activestate.com/ASPN/Cookbook/Python/
 
Vincent

-----Original Message-----
From: python-list-bounces+vincent.raaijmakers=ge.com at python.org [mailto:python-list-bounces+vincent.raaijmakers=ge.com at python.org]On Behalf Of Dan
Sent: Monday, July 26, 2004 1:30 PM
To: python-list at python.org
Subject: Sorted List



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.

 

It's really very simple, just a wrapper around a list that keeps it sorted and uses the bisect module to implement search member functions.

 

If there is a demand for it, I will implement it in C later, as that would be a good learning exercise for me.

 

I'm just finalizing the test code now ( which is sadly much longer than the code itself ).

 

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

 

-Dan

 

 

 

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20040726/2fcdb4c0/attachment.html>


More information about the Python-list mailing list