def is_single_index(slc):
 if (slc.step is None):
  step = 1
 else:
  step = slc.step
 return ((slc.start is not None) and (slc.stop is not None) and ((slc.start + step) >= slc.stop))

def is_single_index ( slc ) : if ( slc . step is None ) : step = 1 else : step = slc . step return ( ( slc . start is not None ) and ( slc . stop is not None ) and ( ( slc . start + step ) >= slc . stop ) )
is the slice equivalent to a single index? .