bpo-32424: Deprecate xml.etree.ElementTree.Element.copy() in favor of copy.copy()#12995
bpo-32424: Deprecate xml.etree.ElementTree.Element.copy() in favor of copy.copy()#12995scoder merged 1 commit intopython:masterfrom
Conversation
|
@scoder @serhiy-storchaka Does this match expectations? |
| """ | ||
| warnings.warn( | ||
| "elem.copy() is deprecated. Use copy.copy(elem) instead.", | ||
| DeprecationWarning |
There was a problem hiding this comment.
Not sure if we should issue a DeprecationWarning straight away (or a PendingDeprecationWarning first), although I personally wouldn't mind, given that the C implementation has shadowed this method for years (in CPython, that is).
@serhiy-storchaka, what do you think?
There was a problem hiding this comment.
FWIW, copy() does not appear in the documentation, either.
There was a problem hiding this comment.
Also, I can't find any record of copy ever having been available in the C implementation; it looks like it was __copy__ from the beginning.
The first appearance of copy in the Python implementation was in f15351d (first released in Python 3.1 and 2.7.4), which deemed it "experimental". 84fae78 (first released in Python 3.4) removed that designation when switching from comments to docstrings.
|
@serhiy-storchaka Any thoughts on this? I think your opinion is the only thing outstanding here. |
Element.copy()in the Python implementation ofxml.etree.ElementTree.DeprecationWarningwhen present.https://bugs.python.org/issue32424