From: <ne...@gm...> - 2008-10-22 17:34:57
|
2008/10/22 <ne...@gm...> > > > 2008/10/22 Yuri Takhteyev <qar...@gm...> > >> >> > Personally, I'd prefer dropping Treap for an OrderedDict. odict [1] >> >> We can definitely think about this. I'll have to read up on odict to >> see if it does everything that we need. Of top of my head, though, >> odict 1400 lines, too big to just include in our code, so we would >> have to worry about an extra dependency. But let's think about this. >> Perhaps we should look at more options too. >> > > I think another one extra dependency is not very good. As an alternative we > can look at SortedDict in Django [1]. We can extend it to do insert not only > by index but by keynames too. > > [1]: > http://code.djangoproject.com/browser/django/trunk/django/utils/datastructures.py#L53 > Just noticed that in PEP 372, that Waylan referred, SortedDict listed as one of the implementations, and there are few others, I think we can find something suitable here [1] [1]: http://www.python.org/dev/peps/pep-0372/#example-implementation |