'Overrides the deepcopy from array.array that does not copy
the object\'s attributes and class type.'

def __deepcopy__(self, memo):

    cls = self.__class__
    copy_ = cls.__new__(cls, self)
    memo[id(self)] = copy_
    copy_.__dict__.update(copy.deepcopy(self.__dict__, memo))
    return copy_
