def stage(func):
 def coro(*args):
  task = None
  while True:
   task = (yield task)
   task = func(*(args + (task,)))
 return coro

def stage ( func ) : def coro ( * args ) : task = None while True : task = ( yield task ) task = func ( * ( args + ( task , ) ) ) return coro
decorate a function to become a simple stage .