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

Function dump

Lib/xml/etree/ElementTree.py:1131–1147  ·  view source on GitHub ↗

Write element tree or element structure to sys.stdout. This function should be used for debugging only. *elem* is either an ElementTree, or a single Element. The exact output format is implementation dependent. In this version, it's written as an ordinary XML file.

(elem)

Source from the content-addressed store, hash-verified

1129
1130
1131def dump(elem):
1132 """Write element tree or element structure to sys.stdout.
1133
1134 This function should be used for debugging only.
1135
1136 *elem* is either an ElementTree, or a single Element. The exact output
1137 format is implementation dependent. In this version, it's written as an
1138 ordinary XML file.
1139
1140 """
1141 # debugging
1142 if not isinstance(elem, ElementTree):
1143 elem = ElementTree(elem)
1144 elem.write(sys.stdout, encoding="unicode")
1145 tail = elem.getroot().tail
1146 if not tail or tail[-1] != "\n":
1147 sys.stdout.write("\n")
1148
1149
1150def indent(tree, space=" ", level=0):

Callers 3

dumpsMethod · 0.50
dump_arrayMethod · 0.50
dump_structMethod · 0.50

Calls 3

writeMethod · 0.95
getrootMethod · 0.95
ElementTreeClass · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…