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 cvxtypes.index().get_special_slice(self, key) else: return cvxtypes.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. if ku.is_special_slice(key): return cvxtypes.index().get_special_slice(self, key) else: return cvxtypes.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. if isinstance(key, tuple) and len(key) == 0: return self elif ku.is_special_slice(key): return cvxtypes.special_index()(self, key) else: return cvxtypes.index()(self, key)