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

Method setAttribute

Lib/xml/dom/minidom.py:758–768  ·  view source on GitHub ↗
(self, attname, value)

Source from the content-addressed store, hash-verified

756 return ""
757
758 def setAttribute(self, attname, value):
759 attr = self.getAttributeNode(attname)
760 if attr is None:
761 attr = Attr(attname)
762 attr.value = value # also sets nodeValue
763 attr.ownerDocument = self.ownerDocument
764 self.setAttributeNode(attr)
765 elif value != attr.value:
766 attr.value = value
767 if attr.isId:
768 _clear_id_cache(self)
769
770 def setAttributeNS(self, namespaceURI, qualifiedName, value):
771 prefix, localname = _nssplit(qualifiedName)

Callers 15

snFunction · 0.80
hnFunction · 0.80
d3.min.jsFile · 0.80
iFunction · 0.80
MFunction · 0.80
SFunction · 0.80
teFunction · 0.80
kFunction · 0.80
SFunction · 0.80
trFunction · 0.80

Calls 4

getAttributeNodeMethod · 0.95
setAttributeNodeMethod · 0.95
AttrClass · 0.85
_clear_id_cacheFunction · 0.85

Tested by 13

testAAAMethod · 0.64
testAABMethod · 0.64
testAddAttrMethod · 0.64
testDeleteAttrMethod · 0.64
testRemoveAttrMethod · 0.64
testHasAttributeMethod · 0.64
testChangeAttrMethod · 0.64
testGetAttrListMethod · 0.64
testGetAttrValuesMethod · 0.64
testAttributeReprMethod · 0.64