MCPcopy Create free account
hub / github.com/instantdb/instant / _jsonable

Function _jsonable

client/packages/python/src/instantdb/_sync/http.py:155–166  ·  view source on GitHub ↗
(value: Any)

Source from the content-addressed store, hash-verified

153
154
155def _jsonable(value: Any) -> Any:
156 if isinstance(value, datetime):
157 return value.isoformat()
158 if isinstance(value, date):
159 return value.isoformat()
160 if isinstance(value, Mapping):
161 return {k: _jsonable(v) for k, v in value.items()}
162 if isinstance(value, list):
163 return [_jsonable(v) for v in value]
164 if isinstance(value, tuple):
165 return [_jsonable(v) for v in value]
166 return value

Callers 1

_requestMethod · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected