Issue #11367: fix documentation of some find* methods in ElementTree
authorEli Bendersky <eliben@gmail.com>
Tue, 12 Mar 2013 13:08:04 +0000 (06:08 -0700)
committerEli Bendersky <eliben@gmail.com>
Tue, 12 Mar 2013 13:08:04 +0000 (06:08 -0700)
Doc/library/xml.etree.elementtree.rst
Lib/xml/etree/ElementTree.py
Misc/ACKS

index e3a24081a302b97aa080cf3edf8f2dad3a97973a..c8cc7738b42201800ba3b960ef0ef511e09f36f6 100644 (file)
@@ -711,26 +711,17 @@ ElementTree Objects
 
    .. method:: find(match)
 
-      Finds the first toplevel element matching *match*.  *match* may be a tag
-      name or path.  Same as getroot().find(match).  Returns the first matching
-      element, or ``None`` if no element was found.
+      Same as :meth:`Element.find`, starting at the root of the tree.
 
 
    .. method:: findall(match)
 
-      Finds all matching subelements, by tag name or path.  Same as
-      getroot().findall(match).  *match* may be a tag name or path.  Returns a
-      list containing all matching elements, in document order.
+      Same as :meth:`Element.findall`, starting at the root of the tree.
 
 
    .. method:: findtext(match, default=None)
 
-      Finds the element text for the first toplevel element with given tag.
-      Same as getroot().findtext(match).  *match* may be a tag name or path.
-      *default* is the value to return if the element was not found.  Returns
-      the text content of the first matching element, or the default value no
-      element was found.  Note that if the element is found, but has no text
-      content, this method returns an empty string.
+      Same as :meth:`Element.findtext`, starting at the root of the tree.
 
 
    .. method:: getiterator(tag=None)
index cd33cd08a6c524ff160fcf37cc0702179d8e13e9..bb468cde698c1d3df421fdb0e47f35acef7cf10d 100644 (file)
@@ -683,8 +683,8 @@ class ElementTree(object):
         return list(self.iter(tag))
 
     ##
-    # Finds the first toplevel element with given tag.
-    # Same as getroot().find(path).
+    # Same as getroot().find(path), starting at the root of the
+    # tree.
     #
     # @param path What element to look for.
     # @keyparam namespaces Optional namespace prefix map.
@@ -704,10 +704,9 @@ class ElementTree(object):
         return self._root.find(path, namespaces)
 
     ##
-    # Finds the element text for the first toplevel element with given
-    # tag.  Same as getroot().findtext(path).
+    # Same as getroot().findtext(path), starting at the root of the tree.
     #
-    # @param path What toplevel element to look for.
+    # @param path What element to look for.
     # @param default What to return if the element was not found.
     # @keyparam namespaces Optional namespace prefix map.
     # @return The text content of the first matching element, or the
@@ -729,8 +728,7 @@ class ElementTree(object):
         return self._root.findtext(path, default, namespaces)
 
     ##
-    # Finds all toplevel elements with the given tag.
-    # Same as getroot().findall(path).
+    # Same as getroot().findall(path), starting at the root of the tree.
     #
     # @param path What element to look for.
     # @keyparam namespaces Optional namespace prefix map.
index 2ef1f4052aa1a6a2bd1fcbddb4aeab6e94a6cf70..75e31bf057ec0f5595c9c8067bae540ef274e9a6 100644 (file)
--- a/Misc/ACKS
+++ b/Misc/ACKS
@@ -398,6 +398,7 @@ Janko Hauser
 Rycharde Hawkes
 Ben Hayden
 Jochen Hayek
+Henrik Heimbuerger
 Christian Heimes
 Thomas Heller
 Malte Helmert