@yield_once
def _iter_alternatives(pattern):
 (start_pos, end_pos) = _boundary_of_alternatives_indices(pattern)
 if (None in (start_pos, end_pos)):
  (yield pattern)
 else:
  for choice in _iter_choices(pattern[start_pos:end_pos]):
   variant = ((pattern[:(start_pos - 1)] + choice) + pattern[(end_pos + 1):])
   for glob_pattern in _iter_alternatives(variant):
    (yield glob_pattern)

@ yield_once def _iter_alternatives ( pattern ) : ( start_pos , end_pos ) = _boundary_of_alternatives_indices ( pattern ) if ( None in ( start_pos , end_pos ) ) : ( yield pattern ) else : for choice in _iter_choices ( pattern [ start_pos : end_pos ] ) : variant = ( ( pattern [ : ( start_pos - 1 ) ] + choice ) + pattern [ ( end_pos + 1 ) : ] ) for glob_pattern in _iter_alternatives ( variant ) : ( yield glob_pattern )
iterates through all glob patterns that can be obtaines by combination of all choices for each alternative .