MCPcopy Index your code
hub / github.com/mongodb/mongo-python-driver / convert

Method convert

test/utils_shared.py:310–317  ·  view source on GitHub ↗
(v)

Source from the content-addressed store, hash-verified

308
309 def __init__(self, data):
310 def convert(v):
311 if isinstance(v, abc.Mapping):
312 return ScenarioDict(v)
313 if isinstance(v, (str, bytes)):
314 return v
315 if isinstance(v, abc.Sequence):
316 return [convert(item) for item in v]
317 return v
318
319 dict.__init__(self, [(k, convert(v)) for k, v in data.items()])
320

Callers

nothing calls this directly

Calls 1

ScenarioDictClass · 0.85

Tested by

no test coverage detected