Suppose I create a shared memory object: from multiprocessing import shared_memory shm_a = shared_memory.SharedMemory(create=True, size=1024) buffer = shm_a.buf and put a generic object of a generic class, such as: class GenericClass: def __init__(self, a, b): self.a = a self.b = b in it: gen_obj_a = GenericClass(1,6) buffer = gen_obj_a Now, in another terminal, I have: from multiprocessing import shared_memory existing_shm = shared_memory.SharedMemory(name='psm_21467_46075') How do I assign a variable, say gen_obj_b, to the GenericClass object in shared memory? In C++, one would do this by casting a void * to the GenericClass object type, but how is this done in Python with shared memory? cf. multiprocessing.shared_memory Python documentation Continue reading...