MCPcopy Create free account
hub / github.com/simplejson/simplejson / default

Method default

simplejson/tests/test_recursion.py:11–17  ·  view source on GitHub ↗
(self, o)

Source from the content-addressed store, hash-verified

9class RecursiveJSONEncoder(json.JSONEncoder):
10 recurse = False
11 def default(self, o):
12 if o is JSONTestObject:
13 if self.recurse:
14 return [JSONTestObject]
15 else:
16 return 'JSONTestObject'
17 return json.JSONEncoder.default(o)
18
19
20class TestRecursion(TestCase):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected