def reify_object_slots(o, s):
    attrs = [getattr(o, attr) for attr in o.__slots__]
    new_attrs = reify(attrs, s)
    if attrs == new_attrs:
        return o
    else:
        newobj = object.__new__(type(o))
        for slot, attr in zip(o.__slots__, new_attrs):
            setattr(newobj, slot, attr)
        return newobj
>>> from logpy.unifymore import reify_object_slots
dataset/ETHPy150Open logpy/logpy/logpy/unifymore.py/reify_object_slots