an expression for an infinite generator?
<p>Is there a straight forward generator expression that can yield infinite elements?</p>

<p>This is a purely theoretical question. No need for a "practical" answer here :)</p>

<hr>

<p>For example, it is easy to make a finite generator:</p>

<pre><code>my_gen = (0 for i in xrange(42))
</code></pre>

<p>However, to make an infinite one I need to "pollute" my namespace with a bogus function:</p>

<pre><code>def _my_gen():
    while True:
        yield 0
my_gen = _my_gen()
</code></pre>

<p>Doing things in a separate file and <code>import</code>-ing latter doesn't count.</p>

<hr>

<p>I also know that <code>itertools.repeat</code> does exactly this. Im curious if there is a one liner solution without that.</p>
