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

Class RecursiveJSONEncoder

simplejson/tests/test_recursion.py:9–17  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

7
8
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 1

test_defaultrecursionMethod · 0.85

Calls

no outgoing calls

Tested by 1

test_defaultrecursionMethod · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…