def __copy__(self, memo):
        cls = self.__class__
        result = cls.__new__(cls)
        memo[id(self)] = result
        for k in self.__slots__:
            try:
                setattr(result, k, copy.copy(getattr(self, k)))
            except AttributeError:
                pass
        return result