[issue36543] Remove old-deprecated ElementTree features (part 2)

Stefan Behnel report at bugs.python.org
Tue May 5 01:55:13 EDT 2020


Stefan Behnel <stefan_ml at behnel.de> added the comment:

Christian, I understand your complaint, but I've actually never seen code in the wild that didn't provide a fallback for the import, usually something like what Serhiy spelled out and explained above:

    try:
        import xml.etree.cElementTree as ET
    except ImportError:
        import xml.etree.ElementTree as ET

This makes it inconvenient for users to emit a deprecation warning for the import, because it would impact perfectly future proof code like the above, without a good way for users to work around it by adapting their code, because the above import order is actually what they want. And there's a lot of such code.

I personally believe that the breakage will be quite limited. But that's a belief, not a fact. I don't have numbers to back it.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue36543>
_______________________________________


More information about the Python-bugs-list mailing list