From fd76eb547dd5d2c8307a89422049b6c3c80541ab Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Mon, 4 Jul 2022 15:51:01 +0200 Subject: gh-94383: Remove ElementTree.Element.copy() method (#94384) xml.etree: Remove the ElementTree.Element.copy() method of the pure Python implementation, deprecated in Python 3.10, use the copy.copy() function instead. The C implementation of xml.etree has no copy() method, only a __copy__() method. --- Lib/xml/etree/ElementTree.py | 13 ------------- 1 file changed, 13 deletions(-) (limited to 'Lib/xml/etree/ElementTree.py') diff --git a/Lib/xml/etree/ElementTree.py b/Lib/xml/etree/ElementTree.py index 1dc80351bf..ebbe2b703b 100644 --- a/Lib/xml/etree/ElementTree.py +++ b/Lib/xml/etree/ElementTree.py @@ -188,19 +188,6 @@ class Element: """ return self.__class__(tag, attrib) - def copy(self): - """Return copy of current element. - - This creates a shallow copy. Subelements will be shared with the - original tree. - - """ - warnings.warn( - "elem.copy() is deprecated. Use copy.copy(elem) instead.", - DeprecationWarning - ) - return self.__copy__() - def __copy__(self): elem = self.makeelement(self.tag, self.attrib) elem.text = self.text -- cgit v1.2.1