is this data structure build-in or I'll have to write my own class?
BjornSteinarFjeldPettersen at gmail.com
Wed Feb 20 19:07:13 CET 2008
On Feb 20, 3:32 pm, "Jorge Vargas" <jorge.var... at gmail.com> wrote:
> On Feb 20, 2008 8:15 AM, Larry Bates <larry.ba... at websafe.com> wrote:
> > Jorge Vargas wrote:
> > > I need a data structure that will let me do:
> > > - attribute access (or index)
> > > - maintain the order (for iter and print)
> > > - be mutable.
> > Sounds like a good time to learn ElementTree (included in Python 2.5 but
> > available for earlier versions).
> I am using ET, to fetch the data from the XML, after that I want a
> plain python object. for the rest of the program.
Ok, you just lost me... Why do you thin ET is not appropriate (*)? It
fits all your requirements, is optimized for representing hierarchical
data (especially xml), it is fast, it is well tested, it has a
community of users, it is included in the standard library, etc., etc.
...maybe I didn't grok what you meant by "plain python object"?
(*) I just had a flashback to the movie ET -- the scene when he's in
the closet ;-)
More information about the Python-list