This answer explains how you would unpickle multiple items in a file.
However, I'm sending pickled objects across the network. If two pickled objects are sent in rapid succession, they could end up read into the same buffer.
How do I replicate the behavior in the linked answer with bytes
objects? Is there a well-defined terminator I can split on, or a way to "advance" the bytes
object?
Ex:
test = pickle.dumps("hello")
test += pickle.dumps("world")
print(pickle.loads(test)) # Prints "hello" -- how do I get "world"?