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

Method getParser

Lib/xml/dom/expatbuilder.py:155–164  ·  view source on GitHub ↗

Return the parser object, creating a new one if needed.

(self)

Source from the content-addressed store, hash-verified

153 return expat.ParserCreate()
154
155 def getParser(self):
156 """Return the parser object, creating a new one if needed."""
157 if not self._parser:
158 self._parser = self.createParser()
159 self._intern_setdefault = self._parser.intern.setdefault
160 self._parser.buffer_text = True
161 self._parser.ordered_attributes = True
162 self._parser.specified_attributes = True
163 self.install(self._parser)
164 return self._parser
165
166 def reset(self):
167 """Free all data structures used during DOM construction."""

Callers 5

parseFileMethod · 0.95
parseStringMethod · 0.95
first_element_handlerMethod · 0.95
parseStringMethod · 0.80

Calls 2

createParserMethod · 0.95
installMethod · 0.95

Tested by

no test coverage detected