Message247764
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. |
|
Date |
User |
Action |
Args |
2015-07-31 19:19:30 | Eric S | set | recipients:
+ Eric S, rhettinger, scoder, eli.bendersky, martin.panter |
2015-07-31 19:19:30 | Eric S | set | messageid: <1438370370.94.0.33002223435.issue24724@psf.upfronthosting.co.za> |
2015-07-31 19:19:30 | Eric S | link | issue24724 messages |
2015-07-31 19:19:30 | Eric S | create | |
|