MCPcopy Index your code
hub / github.com/WebReflection/JSONH / pack

Function pack

py2/jsonh.py:37–50  ·  view source on GitHub ↗
(dict_list)

Source from the content-addressed store, hash-verified

35 return unpack(json.loads(str, *args, **kwargs))
36
37def pack(dict_list):
38 length = len(dict_list)
39 keys = length and dict_list[0].keys() or []
40 klength = len(keys)
41 result = []
42 i = 0
43 while i < length:
44 o = dict_list[i]
45 ki = 0
46 while ki < klength:
47 result.append(o[keys[ki]])
48 ki = ki + 1
49 i = i + 1
50 return [klength] + keys + result
51
52def unpack(hlist):
53 length = len(hlist)

Callers 2

dumpFunction · 0.70
dumpsFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected