human
I wrote the below code

    cache = Cache()
    def wrapped_func(*args, **kwargs):
        params = (args, tuple(sorted(kwargs.items())))
        try:
            cached = cache[params]
        except KeyError:
            cached = []
            for item in func(*args, **kwargs):
                cached.append(item)
                (yield item)
            cache[params] = cached
        else:
            for item in cached:
                (yield item)
    return wrapped_func

What's a good function header?
assistant
#Here's a good function header.

def memoize_generator(func):