'pack and compress an object with pickle and zlib.'

def send_zipped_pickle(self, obj, flags=0, protocol=(-1)):

    pobj = pickle.dumps(obj, protocol)
    zobj = zlib.compress(pobj)
    print ('zipped    pickle    is    %i    bytes' % len(zobj))
    return self.send(zobj, flags=flags)
