Create a new larger array, and copy data over

def resize(self, new_size):
        """Create a new larger array, and copy data over"""
        assert new_size > self.size
        new_data = self._allocate(new_size)
        # copy
        new_data[0:self.size * self.chunk_size] = self.data
        self.size = new_size
        self.data = new_data