This must be simple, but as an only occasional python user, fighting some syntax. This works:
def perms (xs):
for x in itertools.permutations(xs): yield list(x)
But this won't parse:
def perms (xs): for x in itertools.permutations(xs): yield list(x)
Is there some restriction on the one-line function syntax? The body definition (for...) can be either two or one line by itself, and the def: can be one or two lines with a simple body, but combining the two fails. Is there a syntax rule that excludes this?