python one line function definition
<p>This must be simple, but as an only occasional python user, fighting some syntax.
This works:</p>

<pre><code>def perms (xs):
    for x in itertools.permutations(xs): yield list(x) 
</code></pre>

<p>But this won't parse:</p>

<pre><code>def perms (xs): for x in itertools.permutations(xs): yield list(x) 
</code></pre>

<p>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?</p>
