MCPcopy Create free account
hub / github.com/data-apis/python-record-api / default

Function default

record_api/core.py:195–204  ·  view source on GitHub ↗

JSON encoder that special cases some types

(o: object)

Source from the content-addressed store, hash-verified

193
194
195def default(o: object) -> object:
196 """
197 JSON encoder that special cases some types
198 """
199
200 t = encode_module_value(type(o))
201 v = encode(o)
202 if v:
203 return {"t": t, "v": v}
204 return {"t": t}
205
206
207# cache this b/c its expesnive

Callers

nothing calls this directly

Calls 2

encode_module_valueFunction · 0.85
encodeFunction · 0.85

Tested by

no test coverage detected