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 Eric S
Recipients Eric S, eli.bendersky, martin.panter, rhettinger, scoder
Date 2015-07-31.19:19:30
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1438370370.94.0.33002223435.issue24724@psf.upfronthosting.co.za>
In-reply-to
Content
To my preference, the drop-in is verbose and I got a little confused on first read. The current documentation and example seem mostly OK to me. 

If we leave "children" as in "all <country> children of *root*", it doesn't illuminate the fact that if root had a great-great-grandchild also named <country>, then it would return that as well.

The only way I can think to simply clarify it is to use "direct descendents" or "all direct descendents".

Here's how the phrase "direct children" slipped me up when I first read the docs re:findall():

I thought I could rebuild the XML tree like this:

def rebuild_XML_as_whatever(parent)
    for child in parent.findall()
       code_that_attaches_child
       rebuild_XML_as_whatever(child)

instead I had to do this:

def rebuild_XML_as_whatever(parent)
    descendns = parent.findall("./")
    for child_n in range(len(descendns)):
        child = descendns[child_n]

        code_that_attaches_child
        rebuild_XML_as_whatever(child)        

RE:iterfind() if it fits a new format that's fine but renaming would, of course, interfere with backwards compatibility.
History
Date User Action Args
2015-07-31 19:19:30Eric Ssetrecipients: + Eric S, rhettinger, scoder, eli.bendersky, martin.panter
2015-07-31 19:19:30Eric Ssetmessageid: <1438370370.94.0.33002223435.issue24724@psf.upfronthosting.co.za>
2015-07-31 19:19:30Eric Slinkissue24724 messages
2015-07-31 19:19:30Eric Screate