def assoc(self, index, value):
        '''Return a new vector with value associated at index. The implicit
        parameter is not modified.'''
        newvec = ImmutableVector()
        newvec.tree = self.tree.assoc(index, value)
        if index >= self._length:
            newvec._length = index+1
        else:
            newvec._length = self._length
        return newvec
dataset/ETHPy150Open zhemao/funktown/funktown/vector.py/ImmutableVector.assoc/original