[issue32424] Rename copy() to __copy__() in xml.etree.ElementTree.Element Python implementation

Gordon P. Hemsley report at bugs.python.org
Sun Dec 24 13:51:40 EST 2017


New submission from Gordon P. Hemsley <gphemsley at gphemsley.org>:

Currently, the Python implementation of the Element class in xml.etree.ElementTree defines a method called copy() which the C implementation does not define, whereas the C implementation defines a __copy__() method (and a __deepcopy__() method) which the Python implementation does not define.

Given that the documentation makes no mention of a copy() method and that its definition would be masked by a standard import of xml.etree.ElementTree, I propose that it be renamed to __copy__() so that copy.copy() can make use of it.

----------
components: Library (Lib), XML
messages: 309010
nosy: eli.bendersky, gphemsley, scoder
priority: normal
severity: normal
status: open
title: Rename copy() to __copy__() in xml.etree.ElementTree.Element Python implementation
type: behavior
versions: Python 3.7

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


More information about the Python-bugs-list mailing list