MCPcopy Index your code
hub / github.com/clips/pattern / encode

Method encode

pattern/web/json/encoder.py:325–332  ·  view source on GitHub ↗
(self, o)

Source from the content-addressed store, hash-verified

323 """
324
325 def encode(self, o):
326 # Override JSONEncoder.encode because it has hacks for
327 # performance that make things more complicated.
328 chunks = self.iterencode(o, True)
329 if self.ensure_ascii:
330 return ''.join(chunks)
331 else:
332 return u''.join(chunks)
333
334 def iterencode(self, o, _one_shot=False):
335 chunks = super(JSONEncoderForHTML, self).iterencode(o, _one_shot)

Callers

nothing calls this directly

Calls 1

iterencodeMethod · 0.95

Tested by

no test coverage detected