[issue12321] documentation of ElementTree.find

2012-10-14 Thread Eli Bendersky

Changes by Eli Bendersky eli...@gmail.com:


Removed file: http://bugs.python.org/file22406/unnamed

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue12321
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue12321] documentation of ElementTree.find

2012-10-14 Thread Eli Bendersky

Changes by Eli Bendersky eli...@gmail.com:


--
versions: +Python 3.4

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue12321
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue12321] documentation of ElementTree.find

2012-10-14 Thread Eli Bendersky

Eli Bendersky added the comment:

I think this may be intentional. Absolute searches on a ElementTree are 
discouraged with a warning:

def find(self, path, namespaces=None):
# assert self._root is not None
if path[:1] == /:
path = . + path
warnings.warn(
This search is broken in 1.3 and earlier, and will be 
fixed in a future version.  If you rely on the current 
behaviour, change it to %r % path,
FutureWarning, stacklevel=2
)
return self._root.find(path, namespaces)

See what happens when an absolute path is attemped? The code just hacks it 
into a relative path and prints a menacing warning.

So, I would not change the documentation at this point. However, the problem 
should go away if and when the XPath support is improved to really support 
absolute paths.

--
resolution:  - wont fix
stage: needs patch - committed/rejected
status: open - closed

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue12321
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue12321] documentation of ElementTree.find

2012-09-15 Thread Ezio Melotti

Changes by Ezio Melotti ezio.melo...@gmail.com:


--
keywords: +easy

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue12321
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue12321] documentation of ElementTree.find

2012-07-21 Thread Florent Xicluna

Changes by Florent Xicluna florent.xicl...@gmail.com:


--
nosy: +eli.bendersky

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue12321
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue12321] documentation of ElementTree.find

2011-06-19 Thread patrick vrijlandt

patrick vrijlandt patrick.vrijla...@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 rep...@bugs.python.org


 Terry J. Reedy tjre...@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 rep...@bugs.python.org
 http://bugs.python.org/issue12321
 ___


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

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue12321
___span class=Apple-style-span style=border-collapse: collapse; font-family: 
arial, sans-serif; font-size: 13px; [...] Same as getroot().find(match). 
[...] -gt;/spandivfont class=Apple-style-span face=arial, 
sans-serifspan class=Apple-style-span style=border-collapse: 
collapse;[...] For a relative path, this is equivalent 
to /span/fontspan 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
divspan class=Apple-style-span style=border-collapse: collapse; 
font-family: arial, sans-serif; font-size: 13px; br/span/divdivspan 
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
divspan class=Apple-style-span style=border-collapse: collapse; 
font-family: arial, sans-serif; font-size: 13px; br/span/divdivspan 
class=Apple-style-span style=border-collapse: collapse; font-family: arial, 
sans-serif; font-size: 13px; Random thoughts//spanspan 
class=Apple-style-span style=border-collapse: collapse; font-family: arial, 
sans-serif; font-size: 13px; Points to consider:/span/div
divspan 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/divdivspan 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
divspan 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
divspan 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
divspan 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/divdivfont 
class=Apple-style-span face=arial, sans-serifspan 
class=Apple-style-span style=border-collapse: collapse;br
/span/font/divdivdivspan 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/divdiv
span class=Apple-style-span style=border-collapse: collapse; font-family: 
arial, sans-serif; font-size: 13px; br/span/divdivfont 
class=Apple-style-span face=arial, sans-serifspan 
class=Apple-style-span style=border-collapse: collapse;br
/span/fontbrdiv class=gmail_quote2011/6/18 Terry J. Reedy span 
dir=ltrlt;a 
href=mailto:rep...@bugs.python.org;rep...@bugs.python.org/agt;/spanbrblockquote
 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:tjre...@udel.edu;tjre...@udel.edu/agt; 
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.reedybr
stage:  -gt; needs patchbr
versions: +Python 3.3br
divdiv/divdiv class=h5br

[issue12321] documentation of ElementTree.find

2011-06-17 Thread Terry J. Reedy

Terry J. Reedy tjre...@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 rep...@bugs.python.org
http://bugs.python.org/issue12321
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue12321] documentation of ElementTree.find

2011-06-13 Thread patrick vrijlandt

New submission from patrick vrijlandt patrick.vrijla...@gmail.com:

From the python docs for version 3.2:

19.12.3. ElementTree Objects
find(match)
[...] Same as getroot().find(match). [...]

This is not true: tree.find accepts an absolute path (like /*) , whereas 
element.find doesn't. Also applies to findall and findtext.

--
components: XML
messages: 138228
nosy: patrick.vrijlandt
priority: normal
severity: normal
status: open
title: documentation of ElementTree.find
type: behavior
versions: Python 3.2

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue12321
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue12321] documentation of ElementTree.find

2011-06-13 Thread Antoine Pitrou

Changes by Antoine Pitrou pit...@free.fr:


--
nosy: +flox

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue12321
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com