Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
7343cb07
Commit
7343cb07
authored
Mar 12, 2013
by
Eli Bendersky
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue #11367: fix documentation of some find* methods in ElementTree
parent
c30b7b16
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
19 deletions
+8
-19
Doc/library/xml.etree.elementtree.rst
Doc/library/xml.etree.elementtree.rst
+3
-12
Lib/xml/etree/ElementTree.py
Lib/xml/etree/ElementTree.py
+4
-7
Misc/ACKS
Misc/ACKS
+1
-0
No files found.
Doc/library/xml.etree.elementtree.rst
View file @
7343cb07
...
...
@@ -412,26 +412,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)
...
...
Lib/xml/etree/ElementTree.py
View file @
7343cb07
...
...
@@ -705,8 +705,7 @@ class ElementTree:
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.
...
...
@@ -726,10 +725,9 @@ class ElementTree:
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
...
...
@@ -751,8 +749,7 @@ class ElementTree:
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.
...
...
Misc/ACKS
View file @
7343cb07
...
...
@@ -436,6 +436,7 @@ Janko Hauser
Rycharde Hawkes
Ben Hayden
Jochen Hayek
Henrik Heimbuerger
Christian Heimes
Thomas Heller
Malte Helmert
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment