def __getitem__(self, key): """Return a slice/index into the expression. """ # Returning self for scalars causes # the built-in sum to hang. if ku.is_special_slice(key): return types.index().get_special_slice(self, key) else: return types.index()(self, key)
def __getitem__(self, key): """Return a slice/index into the expression. """ # Indexing into a scalar returns the scalar. if self.is_scalar(): return self else: return types.index()(self, key)
def __getitem__(self, key): """Return a slice/index into the expression. """ # Returning self for scalars causes # the built-in sum to hang. return types.index()(self, key)