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

Jorge Vargas jorge.vargas at gmail.com
Wed Feb 27 04:03:35 EST 2008


On Wed, Feb 20, 2008 at 12:07 PM, thebjorn
<BjornSteinarFjeldPettersen at gmail.com> wrote:
> 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.
>
sorry for the late reply, I'm running queries on a webservice, nothing
fancy just http post/get and they give me an XML, the XML has a ton of
information, say 200 nodes, from that I only need 1 node that has 6
more inside, so keeping the whole 200 nodes in memory is not
apropiate, I could make a new ET object with only that part but, I
this data should be fetched every X hours, so I'll prefer it to be my
object so I can code the cache part.

>  ...maybe I didn't grok what you meant by "plain python object"?
>
>  -- bjorn
>
>  (*) I just had a flashback to the movie ET -- the scene when he's in
>  the closet ;-)
>
>
> --
>  http://mail.python.org/mailman/listinfo/python-list
>



More information about the Python-list mailing list