class SomethingPickled(object):

    def __getstate__(self):
        state = self.__dict__.copy()
state['uncycled'] = self.yourUncycleMethod(state['cycled'])
del state['cycle']
return state

def __setstate__(self, state):
    state['cycle'] = self.yourCycleMethod(state['uncycled'])
del state['uncycle']
self.__dict__.update(state)
Пикировка графа с циклами