def send_pyobj(self, obj, flags=0, protocol=-1, callback=None): """Send a Python object as a message using pickle to serialize. See zmq.socket.send_json for details. """ msg = pickle.dumps(obj, protocol) return self.send(msg, flags, callback=callback)