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

Method comment

Lib/xml/etree/ElementTree.py:2026–2037  ·  view source on GitHub ↗
(self, text)

Source from the content-addressed store, hash-verified

2024 self._ns_stack.pop()
2025
2026 def comment(self, text):
2027 if not self._with_comments:
2028 return
2029 if self._ignored_depth:
2030 return
2031 if self._root_done:
2032 self._write('\n')
2033 elif self._root_seen and self._data:
2034 self._flush()
2035 self._write(f'<!--{_escape_cdata_c14n(text)}-->')
2036 if not self._root_seen:
2037 self._write('\n')
2038
2039 def pi(self, target, data):
2040 if self._ignored_depth:

Callers

nothing calls this directly

Calls 3

_flushMethod · 0.95
_escape_cdata_c14nFunction · 0.85
_writeMethod · 0.45

Tested by

no test coverage detected