classification
Title: ElementTree.Element != ElementTree._ElementInterface
Type: behavior Stage: resolved
Components: Library (Lib) Versions: Python 3.4
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: Arfrever, eli.bendersky, jwilk, pitrou, python-dev
Priority: normal Keywords: patch

Created on 2013-05-15 22:39 by jwilk, last changed 2013-05-19 16:21 by eli.bendersky. This issue is now closed.

Files
File name Uploaded Description Edit
test-elementinterface.py jwilk, 2013-05-15 22:39
elementinterface.diff jwilk, 2013-05-15 22:41 review
Messages (7)
msg189319 - (view) Author: Jakub Wilk (jwilk) Date: 2013-05-15 22:39
The xml.etree.ElementTree module provides _Element and _ElementInterface as compatibility aliases for Element. However, in Python 3.3 if the _elementtree module is importable, these classes are not identical: Element is a C implementation, and _Element/_ElementInterface is a Python implementation.

$ python3.2 test-elementinterface.py 
141477524
141477524
141477524

$ python3.3 test-elementinterface.py 
137248544
4144597188
4144597188
msg189320 - (view) Author: Jakub Wilk (jwilk) Date: 2013-05-15 22:41
The attached (untested) patch should fix the bug.
msg189522 - (view) Author: Eli Bendersky (eli.bendersky) * (Python committer) Date: 2013-05-18 15:03
These "compatibility" names are likely to be remnants from the out-of-tree xml etree implementation before it made it into the stdlib. I think they can simply be removed in 3.4, as they're not documented anywhere.
msg189534 - (view) Author: Arfrever Frehtes Taifersar Arahesis (Arfrever) * Date: 2013-05-18 16:28
+1 for deletion of them (even in 3.3.3).
msg189559 - (view) Author: Eli Bendersky (eli.bendersky) * (Python committer) Date: 2013-05-18 22:51
> +1 for deletion of them (even in 3.3.3).

Hmm, I don't think I agree. If someone relies on this thing for some obscure reason, breaking when the switch to 3.4 is made is still less abrasive than a break in a maintenance version. Since this isn't strictly a bug fix, I'm reluctant touching 3.3
msg189560 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2013-05-18 22:54
Agreed with Eli. We shouldn't remove names in bugfix versions.
msg189604 - (view) Author: Roundup Robot (python-dev) Date: 2013-05-19 16:21
New changeset 16a03959819a by Eli Bendersky in branch 'default':
Issue #17988: remove unused alias for Element and rename the used one
http://hg.python.org/cpython/rev/16a03959819a
History
Date User Action Args
2013-05-19 16:21:48eli.benderskysetstatus: open -> closed
resolution: fixed
stage: patch review -> resolved
2013-05-19 16:21:01python-devsetnosy: + python-dev
messages: + msg189604
2013-05-19 16:20:45eli.benderskysetversions: - Python 3.3
2013-05-18 22:54:03pitrousetnosy: + pitrou
messages: + msg189560
2013-05-18 22:51:26eli.benderskysetmessages: + msg189559
2013-05-18 16:28:26Arfreversetmessages: + msg189534
2013-05-18 15:03:22eli.benderskysetmessages: + msg189522
2013-05-16 13:55:34Arfreversetnosy: + Arfrever
2013-05-15 22:45:05ezio.melottisetnosy: + eli.bendersky
stage: patch review
type: behavior

versions: + Python 3.4
2013-05-15 22:41:27jwilksetfiles: + elementinterface.diff
keywords: + patch
messages: + msg189320
2013-05-15 22:39:43jwilkcreate