class Nth(object):

    def __init__(self, n):
        self.n = n
self.i = 0
self.nout = 0

def itervalues(self, x):
    for xi in x:
        self.i += 1
if self.i == self.n:
    self.i = 0
self.nout += 1
yield self.nout, xi
Can I yield from an instance method