def permute_iter(elements):
if len(elements) <= <NUM_LIT:1>:<EOL><INDENT>yield elements<EOL><DEDENT>else:<EOL><INDENT>for perm in permute_iter(elements[<NUM_LIT:1>:]):<EOL><INDENT>for i in range(len(elements)):<EOL><INDENT>yield perm[:i] + elements[<NUM_LIT:0>:<NUM_LIT:1>] + perm[i:]<EOL><DEDENT><DEDENT><DEDENT>
iterator: returns a perumation by each call.