MCPcopy Create free account
hub / github.com/RT-Thread/env-windows / iter

Method iter

tools/python-3.11.9-amd64/Lib/xml/etree/ElementTree.py:385–405  ·  view source on GitHub ↗

Create tree iterator. The iterator loops over the element and all subelements in document order, returning all elements with a matching tag. If the tree structure is modified during iteration, new or removed elements may or may not be included. To get a stabl

(self, tag=None)

Source from the content-addressed store, hash-verified

383 return self.attrib.items()
384
385 def iter(self, tag=None):
386 """Create tree iterator.
387
388 The iterator loops over the element and all subelements in document
389 order, returning all elements with a matching tag.
390
391 If the tree structure is modified during iteration, new or removed
392 elements may or may not be included. To get a stable set, use the
393 list() function on the iterator, and loop over the resulting list.
394
395 *tag* is what tags to look for (default is to return all elements)
396
397 Return an iterator containing all the matching elements.
398
399 """
400 if tag == "*":
401 tag = None
402 if tag is None or self.tag == tag:
403 yield self
404 for e in self._children:
405 yield from e.iter(tag)
406
407 def itertext(self):
408 """Create text iterator.

Callers 6

get_parent_mapFunction · 0.45
select_childFunction · 0.45
selectFunction · 0.45
iterMethod · 0.45
_namespacesFunction · 0.45
XMLIDFunction · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected