@yield_once
def _iter_choices(pattern):
 start_pos = 0
 split_pos_list = [match.start() for match in re.finditer('\\|', pattern)]
 split_pos_list.append(len(pattern))
 for end_pos in split_pos_list:
  if (not _position_is_bracketed(pattern, end_pos)):
   (yield pattern[start_pos:end_pos])
   start_pos = (end_pos + 1)

@ yield_once def _iter_choices ( pattern ) : start_pos = 0 split_pos_list = [ match . start ( ) for match in re . finditer ( '\\|' , pattern ) ] split_pos_list . append ( len ( pattern ) ) for end_pos in split_pos_list : if ( not _position_is_bracketed ( pattern , end_pos ) ) : ( yield pattern [ start_pos : end_pos ] ) start_pos = ( end_pos + 1 )
iterate through each choice of an alternative .