How to create a month iterator
<p>I would like to create a python function that would allow me to iterate over the months from a start point to a stop point.  For example it would look something like</p>

<pre><code>def months(start_month, start_year, end_month, end_year):
</code></pre>

<p>Calling <code>months(8, 2010, 3, 2011)</code> would return:</p>

<pre><code>((8, 2010), (9, 2010), (10, 2010), (11, 2010), (12, 2010), (1, 2011), (2, 2011), (3, 2011))
</code></pre>

<p>The function could just return a tuple of tuples, but I would love to see it as a generator (ie using <code>yield</code>).</p>

<p>I've checked the <code>calendar</code> python module and it doesn't appear to provide this functionality.  I could write a nasty <code>for</code> loop to do it easily enough, but I'm interested to see how gracefully it could be done by a pro.</p>

<p>Thanks.</p>
