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

Method makeelement

Lib/xml/etree/ElementTree.py:178–187  ·  view source on GitHub ↗

Create a new element with the same type. *tag* is a string containing the element name. *attrib* is a dictionary containing the element attributes. Do not call this method, use the SubElement factory function instead.

(self, tag, attrib)

Source from the content-addressed store, hash-verified

176 return "<%s %r at %#x>" % (self.__class__.__name__, self.tag, id(self))
177
178 def makeelement(self, tag, attrib):
179 """Create a new element with the same type.
180
181 *tag* is a string containing the element name.
182 *attrib* is a dictionary containing the element attributes.
183
184 Do not call this method, use the SubElement factory function instead.
185
186 """
187 return self.__class__(tag, attrib)
188
189 def __copy__(self):
190 elem = self.makeelement(self.tag, self.attrib)

Callers 3

test_makeelementMethod · 0.95
__copy__Method · 0.95
SubElementFunction · 0.80

Calls 1

__class__Method · 0.45

Tested by 1

test_makeelementMethod · 0.76