[issue18990] Return root element from ElementTree.XMLPullParser.close() to match ElementTree.XMLParser

Stefan Behnel report at bugs.python.org
Sat Sep 28 11:23:39 CEST 2013


Stefan Behnel added the comment:

Eli didn't explicitly comment on the patch so far, but let me quote some of his earlier comments:

> if the reader discards parts of the tree (by deleting subtrees), then returning the root from close() becomes even more meaningless, because it's no longer the root and we have no idea what it actually is.

Meaning: ".root" is definitely the wrong name for this attribute.

> The API is well defined by the documentation. All the rest is implementation details.

Meaning: ".root" is not a public attribute, the existing (functionally equivalent and therefore redundant) "._root" is enough and makes it clear(er) for readers of the source code that the attribute is really non-public.

I read these as a clear expression of consensus that the public ".root" attribute is not supposed to exist at all. So, given that the next alpha release is due tomorrow, I'd like to see my latest patch applied by then in order to finally move at least a tiny step forward with this.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue18990>
_______________________________________


More information about the Python-bugs-list mailing list