This helps us to avoid passing around very large bytestrings.
>>> frame_split_size([b'12345', b'678'], n=3) # doctest: +SKIP [b'123', b'45', b'678']
>>> merge_frames({'lengths': [3, 3]}, [b'123456']) [b'123', b'456'] >>> merge_frames({'lengths': [6]}, [b'123', b'456']) [b'123456']
This prepends length information to the front of the bytes-like object
unpack_frames
This assumes that length information is at the front of the bytestring, as performed by pack_frames
pack_frames