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

Method get

Lib/xml/etree/ElementTree.py:334–345  ·  view source on GitHub ↗

Get element attribute. Equivalent to attrib.get, but some implementations may handle this a bit more efficiently. *key* is what attribute to look for, and *default* is what to return if the attribute was not found. Returns a string containing the attribute value, o

(self, key, default=None)

Source from the content-addressed store, hash-verified

332 self.text = self.tail = None
333
334 def get(self, key, default=None):
335 """Get element attribute.
336
337 Equivalent to attrib.get, but some implementations may handle this a
338 bit more efficiently. *key* is what attribute to look for, and
339 *default* is what to return if the attribute was not found.
340
341 Returns a string containing the attribute value, or the default if
342 attribute was not found.
343
344 """
345 return self.attrib.get(key, default)
346
347 def set(self, key, value):
348 """Set element attribute.

Callers 11

test_attribMethod · 0.95
test_get_keyword_argsMethod · 0.95
xpath_tokenizerFunction · 0.45
selectFunction · 0.45
select_negatedFunction · 0.45
_includeFunction · 0.45
add_qnameFunction · 0.45
XMLIDFunction · 0.45
_startMethod · 0.45

Calls

no outgoing calls

Tested by 4

test_attribMethod · 0.76
test_get_keyword_argsMethod · 0.76