'To make sure the new item has consistent data type to avoid
misalignment.'

def __setitem__(self, key, value):

    if (isinstance(value, np.ndarray) and (value.dtype == self.dtype)):
        pass
    elif (isinstance(value, chararray.chararray) and (value.itemsize == 1)):
        pass
    elif (self.element_dtype == 'a'):
        value = chararray.array(value, itemsize=1)
    else:
        value = np.array(value, dtype=self.element_dtype)
    np.ndarray.__setitem__(self, key, value)
    self.max = max(self.max, len(value))
