MCPcopy Index your code
hub / github.com/python/cpython / dumps

Function dumps

Lib/idlelib/rpc.py:57–63  ·  view source on GitHub ↗

Return pickled (or marshalled) string for obj.

(obj, protocol=None)

Source from the content-addressed store, hash-verified

55 return unpickle_code, (ms,)
56
57def dumps(obj, protocol=None):
58 "Return pickled (or marshalled) string for obj."
59 # IDLE passes 'None' to select pickle.DEFAULT_PROTOCOL.
60 f = io.BytesIO()
61 p = CodePickler(f, protocol)
62 p.dump(obj)
63 return f.getvalue()
64
65
66class CodePickler(pickle.Pickler):

Callers 8

putmessageMethod · 0.70
test_pickleMethod · 0.50
test_pickle_dump_loadFunction · 0.50
test_pickle_exceptionFunction · 0.50
test_pickleMethod · 0.50
custom_load_dumpMethod · 0.50

Calls 3

getvalueMethod · 0.95
CodePicklerClass · 0.85
dumpMethod · 0.45

Tested by 7

test_pickleMethod · 0.40
test_pickle_dump_loadFunction · 0.40
test_pickle_exceptionFunction · 0.40
test_pickleMethod · 0.40
custom_load_dumpMethod · 0.40

Used in the wild real call sites across dependent graphs

searching dependent graphs…