Why are there no ordered dictionaries?
fuzzyman at gmail.com
Wed Nov 23 09:30:28 CET 2005
Bengt Richter wrote:
> On 22 Nov 2005 02:16:22 -0800, "Fuzzyman" <fuzzyman at gmail.com> wrote:
> >Kay Schluehr wrote:
> >> Christoph Zwerschke wrote:
> >> > That would be also biased (in favour of Python) by the fact that
> >> > probably very little people would look for and use the package in the
> >> > cheese shop if they were looking for ordered dicts.
> >> Does anyone actually use this site? While the Vaults offered a nice
> >> place and a nice interface the Cheese Shop has the appeal of a code
> >> slum.
> >Hmmm.. it's *the* repository for Python code. I expect quite a few
> >people use it...
> I hadn't realized how much stuff was there. I generally google for stuff,
> but I will be looking directly now.
> BTW, I made a mod to your odict that I think/hope is going to be generally faster.
> It requires 2.4 though. It passes the same doctest, so its probably close to the same.
> It stores the ordering info differently, but is also a dict subclass.
odict maintains compatibility with Python 2.2 - so it's not a change
we'd put back into the module I don't think.
Changes that keep compatibility are very welcoemd though.
> Do you happen to have a timing test that exercises various aspects, so I can try it
> before I embarrass myself? Otherwise I guess I'll write something.
The only tests we have are the ones in the module.
If you create some timing tests we'd be interested in having access to
them though. They would be a useful addition.
All the best,
> Would the would-be users chime in with some idea of what kinds of operations are
> most important timing-wise? Which would get the most use? How dynamic would ordering typically be?
>  fairly pervasive little mods actually
> [ 9:15] C:\pywk\clp>diff odict.py odictb.py |wc
> 146 458 4948
> [ 9:15] C:\pywk\clp>wc odict*.py
> 467 1228 12483 odict.py
> 511 1500 14728 odictb.py
> 978 2728 27211 Totals
> Bengt Richter
More information about the Python-list