[Python-Dev] folding cElementTree behind ElementTree in 3.3 (original) (raw)

Eli Bendersky eliben at gmail.com
Wed Feb 8 07:07:42 CET 2012


On Wed, Feb 8, 2012 at 07:10, Fred Drake <fdrake at acm.org> wrote:

On Tue, Feb 7, 2012 at 11:46 PM, Eli Bendersky <eliben at gmail.com> wrote:

The initial proposal of changing *the stdlib import facade* for xml.etree.ElementTree to use the C accelerator (elementtree) by default. I guess this is one source of confusion: what are you referring to an an "import façade"?  When I look in Lib/xml/etree/, I see the ElementTree, ElementPath, and ElementInclude modules, and a wrapper for cElementTree's extension module. There isn't any sort of façade for ElementTree; are you proposing to add one, perhaps in xml.etree/init.py?

AFAICS ElementPath is a helper used by ElementTree, and cElementTree has one of its own. It's not documented for stand-alone use. ElementInclude also isn't documented and doesn't appear to be used anywhere.

The facade can be added to xml/etree/ElementTree.py since that's the only documented module. It can attempt to do:

from _elementtree import *

(which is what cElementTree.py) does, and on failure, just go on doing what it does now.

Eli



More information about the Python-Dev mailing list