is this data structure build-in or I'll have to write my own class?

bearophileHUGS at lycos.com bearophileHUGS at lycos.com
Wed Feb 20 09:08:23 EST 2008


subeen:
> I think you should go for 'dictionary' that is a built-in data
> structure of Python.

The OP asks this too:
> maintain the order (for iter and print)

So I think an "ordered dict" is fitter, the op can search for an odict
implementation, in the cookbook too (I too have written one, but it's
useful only if you have to delete keys often, because it's O(1) for
that operation too, but generally slow if you don't need to delete
keys too).

Bye,
bearophile



More information about the Python-list mailing list