""" open/dulcinea/lib/base.py """ from durus.persistent import PersistentObject from copy import copy from qp.lib.spec import Specified, Mixin class Copyable (Mixin): def copy(self): return copy(self) class DulcineaPersistent (PersistentObject, Specified, Copyable): def __copy__(self): new_instance = PersistentObject.__new__(self.__class__) new_instance.__setstate__(self.__getstate__()) return new_instance def __eq__(self, other): return (self.__class__ == getattr(other, '__class__', None) and other.__getstate__() == self.__getstate__()) def __ne__(self, other): return not self == other def __hash__(self): return id(self)