[issue13988] Expose the C implementation of ElementTree by default when importing ElementTree

Ezio Melotti report at bugs.python.org
Mon Feb 13 10:18:01 CET 2012


Ezio Melotti <ezio.melotti at gmail.com> added the comment:

FWIW the JSON doc doesn't even mention the acceleration module _json, but since people here are used to import cElementTree I think it should be mentioned that it's now deprecated and accelerations are used automatically, so something like this would work:

.. versionchanged:: 3.3
   The :mod:`xml.etree.cElementTree` module is now deprecated.
   A fast implementation will be used automatically whenever available.

I also agree with Éric that there's no need to mention _elementtree (people might try to import that instead, and other implementations might use a different name).

Lib/test/test_xml_etree_c.py could also be removed, and the other tests could import cElementTree too (even though I'm not sure that works too well with doctests).

Shouldn't cElementTree raise an error when _elementtree is missing?
A DeprecationWarning should be added too.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue13988>
_______________________________________


More information about the Python-bugs-list mailing list