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

Stefan Behnel report at bugs.python.org
Fri Feb 10 16:55:23 CET 2012


Stefan Behnel <scoder at users.sourceforge.net> added the comment:

Eli Bendersky, 10.02.2012 16:43:
>>> I don't see a compelling enough reason to break imports in existing code by
>>> removing the cElementTree module, so we should not do that.
> 
> Agreed. Perhaps it should just be deprecated?

Given that its mere existence is currently almost undocumented (except for
one tiny sentence in the docs), I vote for clearly documenting it as
deprecated, yes, with a mention to the fact that it's automatically used by
xml.etree.ElementTree starting with 3.3.

I wouldn't want to see more than that done, though, specifically not a
visible warning when it's being imported. There's far too much code out
there that uses it in previous Python versions. Such a warning would strike
even if it's only being imported conditionally with a try-except, which is
the most common way of doing it. So it would hit most users and require an
awful lot of code to be touched to fix it, for basically zero benefit.

Stefan

----------

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


More information about the Python-bugs-list mailing list