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

Jarek Zgoda jzgoda at o2.usun.pl
Wed Feb 20 14:17:23 CET 2008


Jorge Vargas napisał(a):

> - attribute access (or index)
> - maintain the order (for iter and print)
> - be mutable.

These are all attributes of standard Python lists.

> in case there isn't one. I was thinking having a base class like Bunch
> http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/52308 and on
> top of that keeping a list of the keys and pop/push to the list when
> adding/deleting items. I don't like this idea because I'll have to
> keep each key twice. (in the list and in __dict__, is this the only
> way of doing it?

What is your objective? From the description of this recipe I cann't get
your use case.

-- 
Jarek Zgoda
Skype: jzgoda | GTalk: zgoda at jabber.aster.pl | voice: +48228430101

"We read Knuth so you don't have to." (Tim Peters)



More information about the Python-list mailing list