[Python-Dev] folding cElementTree behind ElementTree in 3.3

Andrew McNabb amcnabb at mcnabbs.org
Wed Feb 22 17:46:10 CET 2012


On Wed, Feb 22, 2012 at 04:24:38AM +0200, Eli Bendersky wrote:
> 
> Andrew, could you elaborate on your use case? Are you using cElementTree to
> do the parsing, or ElementTree (the Python implementation). Can you show a
> short code sample?

I'm mostly using ElementTree because several classes/functions that I
need are not in cElementTree or behave differently.  Specifically, the
program loads TreeBuilder, XMLParser, iterparse from ElementTree; the
only class from cElementTree that works is Element.  A shortened version
of the program is available here:

http://aml.cs.byu.edu/~amcnabb/gutenberg-short.py

By the way, this code is just one example of how one might rely on the
documented extensibility of ElementTree.  There are probably many other
examples out there that look nothing like mine.

--
Andrew McNabb
http://www.mcnabbs.org/andrew/
PGP Fingerprint: 8A17 B57C 6879 1863 DE55  8012 AB4D 6098 8826 6868


More information about the Python-Dev mailing list