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

Function SubElement

Lib/xml/etree/ElementTree.py:419–434  ·  view source on GitHub ↗

Subelement factory which creates an element instance, and appends it to an existing parent. The element tag, attribute names, and attribute values can be either bytes or Unicode strings. *parent* is the parent element, *tag* is the subelements name, *attrib* is an optional dire

(parent, tag, /, attrib={}, **extra)

Source from the content-addressed store, hash-verified

417
418
419def SubElement(parent, tag, /, attrib={}, **extra):
420 """Subelement factory which creates an element instance, and appends it
421 to an existing parent.
422
423 The element tag, attribute names, and attribute values can be either
424 bytes or Unicode strings.
425
426 *parent* is the parent element, *tag* is the subelements name, *attrib* is
427 an optional directory containing element attributes, *extra* are
428 additional attributes given as keyword arguments.
429
430 """
431 attrib = {**attrib, **extra}
432 element = parent.makeelement(tag, attrib)
433 parent.append(element)
434 return element
435
436
437def Comment(text=None):

Callers

nothing calls this directly

Calls 2

makeelementMethod · 0.80
appendMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…