Python: print a generator expression?
<p>In the Python shell, if I enter a list comprehension such as:</p>

<pre><code>&gt;&gt;&gt; [x for x in string.letters if x in [y for y in "BigMan on campus"]]
</code></pre>

<p>I get a nicely printed result:</p>

<pre><code>['a', 'c', 'g', 'i', 'm', 'n', 'o', 'p', 's', 'u', 'B', 'M']
</code></pre>

<p>Same for a dictionary comprehension:</p>

<pre><code>&gt;&gt;&gt; {x:x*2 for x in range(1,10)}
{1: 2, 2: 4, 3: 6, 4: 8, 5: 10, 6: 12, 7: 14, 8: 16, 9: 18}
</code></pre>

<p>If I enter a generator expression, I get not such a friendly response: </p>

<pre><code>&gt;&gt;&gt; (x for x in string.letters if x in (y for y in "BigMan on campus"))
&lt;generator object &lt;genexpr&gt; at 0x1004a0be0&gt;
</code></pre>

<p>I know I can do this:</p>

<pre><code>&gt;&gt;&gt; for i in _: print i,
a c g i m n o p s u B M
</code></pre>

<p>Other than that (or writing a helper function) can I easily evaluate and print that generator object in the interactive shell? </p>
