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

Method clear

Lib/xml/etree/ElementTree.py:323–332  ·  view source on GitHub ↗

Reset element. This function removes all subelements, clears all attributes, and sets the text and tail attributes to None.

(self)

Source from the content-addressed store, hash-verified

321 return ElementPath.iterfind(self, path, namespaces)
322
323 def clear(self):
324 """Reset element.
325
326 This function removes all subelements, clears all attributes, and sets
327 the text and tail attributes to None.
328
329 """
330 self.attrib.clear()
331 self._children = []
332 self.text = self.tail = None
333
334 def get(self, key, default=None):
335 """Get element attribute.

Callers 4

test_bpo_31728Method · 0.95
test_makeelementMethod · 0.95
test_qnameMethod · 0.95
iterfindFunction · 0.45

Calls

no outgoing calls

Tested by 3

test_bpo_31728Method · 0.76
test_makeelementMethod · 0.76
test_qnameMethod · 0.76