MCPcopy Index your code
hub / github.com/python/cpython / iterfind

Method iterfind

Lib/xml/etree/ElementTree.py:665–685  ·  view source on GitHub ↗

Find all matching subelements by tag name or path. Same as getroot().iterfind(path), which is element.iterfind() *path* is a string having either an element tag or an XPath, *namespaces* is an optional mapping from namespace prefix to full name. Return an iterable

(self, path, namespaces=None)

Source from the content-addressed store, hash-verified

663 return self._root.findall(path, namespaces)
664
665 def iterfind(self, path, namespaces=None):
666 """Find all matching subelements by tag name or path.
667
668 Same as getroot().iterfind(path), which is element.iterfind()
669
670 *path* is a string having either an element tag or an XPath,
671 *namespaces* is an optional mapping from namespace prefix to full name.
672
673 Return an iterable yielding all matching elements in document order.
674
675 """
676 # assert self._root is not None
677 if path[:1] == "/":
678 path = "." + path
679 warnings.warn(
680 "This search is broken in 1.3 and earlier, and will be "
681 "fixed in a future version. If you rely on the current "
682 "behaviour, change it to %r" % path,
683 FutureWarning, stacklevel=2
684 )
685 return self._root.iterfind(path, namespaces)
686
687 def write(self, file_or_filename,
688 encoding=None,

Callers 1

test_interfaceMethod · 0.95

Calls 2

warnMethod · 0.45
iterfindMethod · 0.45

Tested by 1

test_interfaceMethod · 0.76