def hashable_index(index):
 if (type(index) is tuple):
  return tuple(map(hashable_index, index))
 elif isinstance(index, list):
  return hashable_list(index)
 elif isinstance(index, slice):
  return _slice(index.start, index.stop, index.step)
 return index

def hashable_index ( index ) : if ( type ( index ) is tuple ) : return tuple ( map ( hashable_index , index ) ) elif isinstance ( index , list ) : return hashable_list ( index ) elif isinstance ( index , slice ) : return _slice ( index . start , index . stop , index . step ) return index
convert slice-thing into something hashable .