New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add code deprecations in ElementTree #73390
Comments
Some deprecated ElementTree features are deprecated only in the documentation or in Python implementation (that is virtually the same since C implementation is default). Proposed patch adds missed deprecations is code. It also makes warnings be ignored only in tests where they are expected. This is possible since converting doctests to unittests some time ago. Added deprecations:
Ned, is it appropriate to commit the patch (or its part) in 3.6? The discrepancy between Python and C implementation can be considered as a bug. What are your thoughts? |
Isn’t cElementTree useful and recommended in 2.7? It would be awkward to deprecate it in Python 3. But I guess the other cases should be okay to deprecate in 3.7. |
Yes, I have a doubt about this too. Perhaps it can be just removed. The idiomatic code in Python 2 is: try: |
I'm ok with the deprecations. Regarding the cElementTree module, this is a bit problematic. The idiomatic import has lost its use in Py2.5 when ET and cET were added to the stdlib, so code that was written for Py2.5 or later (e.g. because it uses generators) might no longer have that cascade. On the other hand, issuing a warning for the module would also hit this import cascade, even though the code would work just fine without cElementTree. One argument speaks for deprecation, the other for removal. However, cElementTree is redundant now, so it should be removed eventually. And since that removal would break some code anyway, I'd be ok with just removing it without prior import warnings. People can then decide whether they want to fix their code by adding the well-known import cascade (and not get annoying warnings for it) or by switching entirely to plain ET and not looking back. |
The deprecation of the cElementTree module was excluded. |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: