def __getstate__(self, network=False, *a, **k): ret = ObservableSlotsSavable.__getstate__(self, *a, **k) if ret['format'] is not None: ret['format'] = dict(ret['format']) exceptions = ret['exceptions'] if network: ret.pop('edit_toggle', None) if not exceptions: #could be a tuple return ret exceptions = dict(exceptions) #do not want to change our own state for ex, exobj in exceptions.items(): exceptions[ex] = exobj.__getstate__(network=network) ret['exceptions'] = exceptions return ret