[issue12321] documentation of ElementTree.find

patrick vrijlandt report at bugs.python.org
Sun Jun 19 20:16:18 CEST 2011


patrick vrijlandt <patrick.vrijlandt at gmail.com> added the comment:

[...] Same as getroot().find(match). [...] ->
[...] For a relative path, this is equivalent to getroot().find(match).
Additionally, this form accepts an absolute path. [...]

This is easy, but might not be a very good solution.

Random thoughts/Points to consider:
It does help the novice in debugging his expressions.
A peculiarity of this implementation is documented.
As others have stated, the whole elementpath documentation within the python
docs is incomplete. Should we document the exception but not the rule?
It makes no real sense to do a an absolute search from an element. However,
it's not ambiguous.
lxml does accept the absolute path search from an element.

Actually, I think it's up to Fredrik to decide.

2011/6/18 Terry J. Reedy <report at bugs.python.org>

>
> Terry J. Reedy <tjreedy at udel.edu> added the comment:
>
> Are you requesting that the doc be changed or the code?
> >From the title, I would infer the doc (which is much easier ;-).
> If so, can you suggest an actual revised text?
>
> ----------
> nosy: +terry.reedy
> stage:  -> needs patch
> versions: +Python 3.3
>
> _______________________________________
> Python tracker <report at bugs.python.org>
> <http://bugs.python.org/issue12321>
> _______________________________________
>

----------
Added file: http://bugs.python.org/file22406/unnamed

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue12321>
_______________________________________
-------------- next part --------------
<span class="Apple-style-span" style="border-collapse: collapse; font-family: arial, sans-serif; font-size: 13px; ">[...] Same as getroot().find(match). [...] -&gt;</span><div><font class="Apple-style-span" face="arial, sans-serif"><span class="Apple-style-span" style="border-collapse: collapse;">[...] For a relative path, this is equivalent to </span></font><span class="Apple-style-span" style="border-collapse: collapse; font-family: arial, sans-serif; font-size: 13px; ">getroot().find(match). Additionally, this form accepts an absolute path. [...]</span></div>
<div><span class="Apple-style-span" style="border-collapse: collapse; font-family: arial, sans-serif; font-size: 13px; "><br></span></div><div><span class="Apple-style-span" style="border-collapse: collapse; font-family: arial, sans-serif; font-size: 13px; ">This is easy, but might not be a very good solution. </span></div>
<div><span class="Apple-style-span" style="border-collapse: collapse; font-family: arial, sans-serif; font-size: 13px; "><br></span></div><div><span class="Apple-style-span" style="border-collapse: collapse; font-family: arial, sans-serif; font-size: 13px; ">Random thoughts/</span><span class="Apple-style-span" style="border-collapse: collapse; font-family: arial, sans-serif; font-size: 13px; ">Points to consider:</span></div>
<div><span class="Apple-style-span" style="border-collapse: collapse; font-family: arial, sans-serif; font-size: 13px; ">It does help the novice in debugging his expressions. </span></div><div><span class="Apple-style-span" style="border-collapse: collapse; font-family: arial, sans-serif; font-size: 13px; ">A peculiarity of this implementation is documented.</span></div>
<div><span class="Apple-style-span" style="border-collapse: collapse; font-family: arial, sans-serif; font-size: 13px; ">As others have stated, the whole elementpath documentation within the python docs is incomplete. Should we document the exception but not the rule?</span></div>
<div><span class="Apple-style-span" style="border-collapse: collapse; font-family: arial, sans-serif; font-size: 13px; ">It makes no real sense to do a an absolute search from an element. However, it&#39;s not ambiguous.</span></div>
<div><span class="Apple-style-span" style="border-collapse: collapse; font-family: arial, sans-serif; font-size: 13px; ">lxml does accept the absolute path search from an element.</span></div><div><font class="Apple-style-span" face="arial, sans-serif"><span class="Apple-style-span" style="border-collapse: collapse;"><br>
</span></font></div><div><div><span class="Apple-style-span" style="border-collapse: collapse; font-family: arial, sans-serif; font-size: 13px; ">Actually, I think it&#39;s up to Fredrik to decide. </span></div></div><div>
<span class="Apple-style-span" style="border-collapse: collapse; font-family: arial, sans-serif; font-size: 13px; "><br></span></div><div><font class="Apple-style-span" face="arial, sans-serif"><span class="Apple-style-span" style="border-collapse: collapse;"><br>
</span></font><br><div class="gmail_quote">2011/6/18 Terry J. Reedy <span dir="ltr">&lt;<a href="mailto:report at bugs.python.org">report at bugs.python.org</a>&gt;</span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<br>
Terry J. Reedy &lt;<a href="mailto:tjreedy at udel.edu">tjreedy at udel.edu</a>&gt; added the comment:<br>
<br>
Are you requesting that the doc be changed or the code?<br>
&gt;From the title, I would infer the doc (which is much easier ;-).<br>
If so, can you suggest an actual revised text?<br>
<br>
----------<br>
nosy: +terry.reedy<br>
stage:  -&gt; needs patch<br>
versions: +Python 3.3<br>
<div><div></div><div class="h5"><br>
_______________________________________<br>
Python tracker &lt;<a href="mailto:report at bugs.python.org">report at bugs.python.org</a>&gt;<br>
&lt;<a href="http://bugs.python.org/issue12321" target="_blank">http://bugs.python.org/issue12321</a>&gt;<br>
_______________________________________<br>
</div></div></blockquote></div><br></div>


More information about the Python-bugs-list mailing list