[Python-Dev] folding cElementTree behind ElementTree in 3.3

Eli Bendersky eliben at gmail.com
Wed Feb 8 05:31:58 CET 2012


On Wed, Feb 8, 2012 at 06:15, Nick Coghlan <ncoghlan at gmail.com> wrote:
> On Wed, Feb 8, 2012 at 1:59 PM, Eli Bendersky <eliben at gmail.com> wrote:
>> Is there a good reason why xml.etree.ElementTree /
>> xml.etree.cElementTree did not "receive this treatment"?
>
> See PEP 360, which lists "Externally Maintained Packages". In the past
> we allowed additions to the standard library without requiring that
> the standard library version become the master version. These days we
> expect python.org to become the master version, perhaps with backports
> and experimental features published on PyPI (cf. packaging vs
> distutils2, unittest vs unittest, contextlib vs contextlib2).
>
> ElementTree was one of the last of those externally maintained modules
> added to the standard library - as documented in the PEP, it's still
> officially maintained by Fredrik Lundh. Folding the two
> implementations together in the standard library would mean officially
> declaring that xml.etree is now an independently maintained fork of
> Fredrik's version rather than just a "snapshot in time" of a
> particular version (which is what it has been historically).
>
> So the reasons for keeping these two separate to date isn't technical,
> it's because Fredrik publishes them as separate modules.
>

The idea is to import the C module when xml.etree.ElementTree is
imported, falling back to the Python module if that fails for some
reason. So this is not modifying the modules, just the Python stdlib
facade for them.

Besides, in http://mail.python.org/pipermail/python-dev/2011-December/114812.html
Stefan Behnel said "[...] Today, ET is *only* being maintained in the
stdlib by Florent
Xicluna [...]". Is this not true?

Eli

P.S. Would declaring that xml.etree is now independently maintained by
pydev be a bad thing? Why?


More information about the Python-Dev mailing list