def findall():
    yield 1
yield 2
yield 3


class Produce(object):

    def __init__(self, iterable):
        self._it = iterable
self.total = 0

def __iter__(self):
    return self

def __next__(self):
    self.total += 1
return next(self._it)
next = __next__
Python function that produces both generator and aggregate results