How to override __iter__() for custom class?
<p>What I'm trying to do is reuse generator</p>

<pre><code>class Rect(object):
   ...
   def __iter__(self):
       for y in xrange(self.tl.y, self.br.y + 1):
           for x in xrange(self.tl.x, self.br.x + 1):
               yield Point(x, y)
</code></pre>

<p>in child class. I've tried write something like</p>

<pre><code>class Block(Rect):
    ...
    def __iter__(self):
        for p in super(Block, self):
            yield p + self.offset
</code></pre>

<p>but obviously that didn't work.</p>

<p>My question is can that be done without copying code from parent class and what is most pythonic approach to re-usability of inherited code.</p>