how to get a reference to the function generator that created an iterator?
<p>I would like to get a reference back to the function that created an iterator. In my case I am interested in getting the original docstring.</p>

<p>Example:</p>

<pre><code>def my_generator():
    """this is my generator"""
    for x in (1,2,3):
        yield x


my_iter = my_generator()

# in another part of my code where I Only have access to the iterator
# no access to the generator function "my_generator"
assert my_iter.????.__doc__ == "this is my generator"
</code></pre>
