def slice_shape(lst, slices):
 if atomp(lst):
  return []
 return ([len(lst[slices[0]])] + slice_shape(lst[0], slices[1:]))

def slice_shape ( lst , slices ) : if atomp ( lst ) : return [ ] return ( [ len ( lst [ slices [ 0 ] ] ) ] + slice_shape ( lst [ 0 ] , slices [ 1 : ] ) )
get the shape of lst after slicing: slices is a list of slice objects .