MCPcopy
hub / github.com/mitmproxy/mitmproxy / dumps

Function dumps

mitmproxy/io/tnetstring.py:50–59  ·  view source on GitHub ↗

This function dumps a python object as a tnetstring.

(value: TSerializable)

Source from the content-addressed store, hash-verified

48
49
50def dumps(value: TSerializable) -> bytes:
51 """
52 This function dumps a python object as a tnetstring.
53 """
54 # This uses a deque to collect output fragments in reverse order,
55 # then joins them together at the end. It's measurably faster
56 # than creating all the intermediate strings.
57 q: collections.deque = collections.deque()
58 _rdumpq(q, 0, value)
59 return b"".join(q)
60
61
62def dump(value: TSerializable, file_handle: BinaryIO) -> None:

Callers 2

dumpFunction · 0.85
_searchMethod · 0.85

Calls 2

_rdumpqFunction · 0.85
joinMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…