Suppose we write a very simple bi-directional generator in Python:
def share_of_total(): s = 0 new_num = 0 while True: new_num = yield new