import pickle

class ThingHolder:
    __slots__ = ['thing']
    def __init__(self, thing):
        print(self, thing)
        self.thing = thing
    def __reduce__(self):
        return (ThingHolder, (self.thing,))

th = ThingHolder(None)
th.thing = th

th2 = pickle.loads(pickle.dumps(th, pickle.HIGHEST_PROTOCOL))

print(th2, th2.thing)