This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author scoder
Recipients eli.bendersky, martin.panter, rhettinger, scoder
Date 2014-04-02.06:01:59
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <533BA7D6.3030805@behnel.de>
In-reply-to <1396295386.41.0.633466181565.issue21028@psf.upfronthosting.co.za>
Content
> Add all the element methods to the elementtree object.

Ok, but why? An ElementTree object *is not* an Element. It's a
representation of a document that *has* a root Element.

It makes sense for a document to allow searches over its content, and the
ElementTree class currently supports that, using the find*() or iter()
methods. They are "deep" or "global" content accessor shortcuts, in
addition to the path through the normal getroot() method.

But I can't see how making ElementTree objects look and behave like their
own root Element improves anything. Instead, it would just make the
distinction between the two completely unclear, and would also lead to
quirks like the question why iterating over a document yields the second
level of children. Or the question what the "attrib" property of a document
could mean.

Instead of blurring it, would you have an idea what we could improve in the
documentation to make this distinction clearer?
History
Date User Action Args
2014-04-02 06:02:00scodersetrecipients: + scoder, rhettinger, eli.bendersky, martin.panter
2014-04-02 06:01:59scoderlinkissue21028 messages
2014-04-02 06:01:59scodercreate