Re: cElementTree clear semantics

2005-09-26 Thread Paul Boddie
Fredrik Lundh wrote: > well, for the record, I strongly recommend people to post questions in > public forums. I wasn't saying that such advice was wrong, though. I suppose the quality or responsiveness of advice is going to vary somewhat depending on a number of factors... > it's often a good id

Let's enjoy this list! [Re: "Re: cElementTree clear semantics"]

2005-09-25 Thread François Pinard
[D H] > I think it means you should fuck off, asshole. Such language looks very inappropriate to me in a public list, and builds a bad and long-lasting prejudice against those resorting to it. Flamers should rather, for their own image, email each other privately on their matters (yet D.H. is not

Grant Edwards [Re: cElementTree clear semantics]

2005-09-25 Thread D H
Grant Edwards wrote: > On 2005-09-25, D H <[EMAIL PROTECTED]> wrote: > > I would recommend emailing the author of a library when you have a question about that library. You should know that yourself as well. >>> >>>Why?? >> >>Please tell me I don't have to explain to you why the auth

Re: cElementTree clear semantics

2005-09-25 Thread Neil Hodgson
Paul Boddie: > Regardless of anyone's alleged connection with Boo or newsgroup > participation level, the advice to contact the package > author/maintainer is sound. It happens every now and again that people > post questions to comp.lang.python about fairly specific issues or > packages that woul

Re: cElementTree clear semantics

2005-09-25 Thread Grant Edwards
On 2005-09-25, D H <[EMAIL PROTECTED]> wrote: >>>I would recommend emailing the author of a library when you >>>have a question about that library. You should know that >>>yourself as well. >> >> Why?? > > Please tell me I don't have to explain to you why the author > of a 3rd party library migh

Re: cElementTree clear semantics

2005-09-25 Thread D H
Fredrik Lundh wrote: > Paul Boddie wrote: > > >>Regardless of anyone's alleged connection with Boo or newsgroup >>participation level, the advice to contact the package >>author/maintainer is sound. It happens every now and again that people >>post questions to comp.lang.python about fairly speci

Re: cElementTree clear semantics

2005-09-25 Thread D H
Grant Edwards wrote: > On 2005-09-25, D H <[EMAIL PROTECTED]> wrote: > Igor V. Rafienko wrote: >This gave me the desired behaviour, but: > >* It looks *very* ugly >* It's twice as slow as version which sees 'end'-events only. > >Now, there *has* to be a better

Re: cElementTree clear semantics

2005-09-25 Thread Fredrik Lundh
Paul Boddie wrote: > Regardless of anyone's alleged connection with Boo or newsgroup > participation level, the advice to contact the package > author/maintainer is sound. It happens every now and again that people > post questions to comp.lang.python about fairly specific issues or > packages tha

Re: cElementTree clear semantics

2005-09-25 Thread Grant Edwards
On 2005-09-25, D H <[EMAIL PROTECTED]> wrote: >>>Igor V. Rafienko wrote: >>> This gave me the desired behaviour, but: * It looks *very* ugly * It's twice as slow as version which sees 'end'-events only. Now, there *has* to be a better way. What am I missing? >>> >>>Try ema

Re: cElementTree clear semantics

2005-09-25 Thread Reinhold Birkenfeld
Paul Boddie wrote: > Reinhold Birkenfeld wrote: >> D H wrote: >> > I would recommend emailing the author of a library when you have a >> > question about that library. You should know that yourself as well. >> >> Well, if I had e.g. a question about Boo, I would of course first ask >> here because

Re: cElementTree clear semantics

2005-09-25 Thread Paul Boddie
Reinhold Birkenfeld wrote: > D H wrote: > > I would recommend emailing the author of a library when you have a > > question about that library. You should know that yourself as well. > > Well, if I had e.g. a question about Boo, I would of course first ask > here because I know the expert writes h

Re: cElementTree clear semantics

2005-09-25 Thread Fredrik Lundh
Igor V. Rafienko wrote: > The problem is that the file looks like this: > > ... lots of schnappi records ... okay. I think your first approach from cElementTree import iterparse for event, elem in iterparse("data.xml"): if elem.tag == "schnappi": count += 1

Fredrik Lundh [Re: Reinhold Birkenfeld [Re: "Re: cElementTree clear semantics"]]

2005-09-25 Thread D H
Fredrik Lundh wrote: > Doug Holton wrote: > > >>You're the only one making any association between this thread about >>celementree and boo. > > > really? judging from the Original-From header in your posts, your internet > provider is sure making the same association... You seriously need som

Re: cElementTree clear semantics

2005-09-25 Thread Igor V. Rafienko
[ Fredrik Lundh ] [ ... ] > the iterparse/clear approach works best if your XML file has a > record-like structure. if you have toplevel records with lots of > schnappi records in them, iterate over the records and use find > (etc) to locate the subrecords you're interested in: (...) The proble

Re: Reinhold Birkenfeld [Re: "Re: cElementTree clear semantics"]

2005-09-25 Thread Fredrik Lundh
Doug Holton wrote: > You're the only one making any association between this thread about > celementree and boo. really? judging from the Original-From header in your posts, your internet provider is sure making the same association... -- http://mail.python.org/mailman/listinfo/python-list

Reinhold Birkenfeld [Re: "Re: cElementTree clear semantics"]

2005-09-25 Thread D H
Reinhold Birkenfeld wrote: > D H wrote: > >>Reinhold Birkenfeld wrote: >> >>>D H wrote: >>> >>> D H wrote: >Reinhold Birkenfeld wrote: > > > >>Well, if I had e.g. a question about Boo, I would of course first ask >>here because I know the expert writes here. >

Re: cElementTree clear semantics

2005-09-25 Thread Fredrik Lundh
Igor V. Rafienko wrote: > Finally, I thought about keeping track of when to clear and when not > to by subscribing to start and end elements (so that I would collect > the entire -subtree in memory and only than release it): > > from cElementTree import iterparse > clear_flag = True > for event, e

Re: "Re: cElementTree clear semantics"

2005-09-25 Thread Reinhold Birkenfeld
D H wrote: > Reinhold Birkenfeld wrote: >> D H wrote: >> >>>D H wrote: >>> Reinhold Birkenfeld wrote: >Well, if I had e.g. a question about Boo, I would of course first ask >here because I know the expert writes here. > >Reinhold Reinhold Birkenfeld also

Reinhold Birkenfeld [Re: "Re: cElementTree clear semantics"]

2005-09-25 Thread D H
Reinhold Birkenfeld wrote: > D H wrote: > >>D H wrote: >> >>>Reinhold Birkenfeld wrote: >>> >>> Well, if I had e.g. a question about Boo, I would of course first ask here because I know the expert writes here. Reinhold >>> >>> >>>Reinhold Birkenfeld also wrote: >>> > If I had want

Re: "Re: cElementTree clear semantics"

2005-09-25 Thread Reinhold Birkenfeld
D H wrote: > D H wrote: >> Reinhold Birkenfeld wrote: >> >>> >>> Well, if I had e.g. a question about Boo, I would of course first ask >>> here because I know the expert writes here. >>> >>> Reinhold >> >> >> Reinhold Birkenfeld also wrote: >> > If I had wanted to say "you have opinions? fuck o

Re: cElementTree clear semantics

2005-09-25 Thread Reinhold Birkenfeld
D H wrote: > Reinhold Birkenfeld wrote: > >> >> Well, if I had e.g. a question about Boo, I would of course first ask >> here because I know the expert writes here. >> >> Reinhold > > Reinhold Birkenfeld also wrote: > > If I had wanted to say "you have opinions? fuck off!", I would have said >

Reinhold Birkenfeld [was "Re: cElementTree clear semantics"]

2005-09-25 Thread D H
D H wrote: > Reinhold Birkenfeld wrote: > >> >> Well, if I had e.g. a question about Boo, I would of course first ask >> here because I know the expert writes here. >> >> Reinhold > > > Reinhold Birkenfeld also wrote: > > If I had wanted to say "you have opinions? fuck off!", I would have said

Re: cElementTree clear semantics

2005-09-25 Thread D H
Reinhold Birkenfeld wrote: > > Well, if I had e.g. a question about Boo, I would of course first ask > here because I know the expert writes here. > > Reinhold Reinhold Birkenfeld also wrote: > If I had wanted to say "you have opinions? fuck off!", I would have said >"you have opinions? fuck

Re: cElementTree clear semantics

2005-09-25 Thread Reinhold Birkenfeld
D H wrote: > Reinhold Birkenfeld wrote: >> D H wrote: >> >>>Igor V. Rafienko wrote: >>> This gave me the desired behaviour, but: * It looks *very* ugly * It's twice as slow as version which sees 'end'-events only. Now, there *has* to be a better way. What am I missing? >>

Re: cElementTree clear semantics

2005-09-25 Thread D H
Reinhold Birkenfeld wrote: > D H wrote: > >>Igor V. Rafienko wrote: >> >>>This gave me the desired behaviour, but: >>> >>>* It looks *very* ugly >>>* It's twice as slow as version which sees 'end'-events only. >>> >>>Now, there *has* to be a better way. What am I missing? >>> >> >>Try emailing the

Re: cElementTree clear semantics

2005-09-25 Thread Reinhold Birkenfeld
D H wrote: > Igor V. Rafienko wrote: >> This gave me the desired behaviour, but: >> >> * It looks *very* ugly >> * It's twice as slow as version which sees 'end'-events only. >> >> Now, there *has* to be a better way. What am I missing? >> > > Try emailing the author for support. I don't think

Re: cElementTree clear semantics

2005-09-25 Thread D H
Igor V. Rafienko wrote: > This gave me the desired behaviour, but: > > * It looks *very* ugly > * It's twice as slow as version which sees 'end'-events only. > > Now, there *has* to be a better way. What am I missing? > Try emailing the author for support. -- http://mail.python.org/mailman/lis

cElementTree clear semantics

2005-09-25 Thread Igor V. Rafienko
Hi, I am trying to understand how cElementTree's clear works: I have a (relatively) large XML file, that I do not wish to load into memory. So, naturally, I tried something like this: from cElementTree import iterparse for event, elem in iterparse("data.xml"): if elem.tag == "schnappi":