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 types.index()(self, key[0], key[1])