def child(): print 'Child started.' yield bluelet.null() print 'Child resumed.' yield bluelet.null() print 'Child ending.' yield bluelet.end(42)
def parent(): print 'Parent started.' yield bluelet.null() print 'Parent resumed.' result = yield child() print 'Child returned:', repr(result) print 'Parent ending.'
def exc_child(): yield bluelet.null() raise Exception()