def inlineCallbacks(f):
 @wraps(f)
 def unwindGenerator(*args, **kwargs):
  try:
   gen = f(*args, **kwargs)
  except _DefGen_Return:
   raise TypeError(('inlineCallbacks requires %r to produce a generator; insteadcaught returnValue being used in a non-generator' % (f,)))
  if (not isinstance(gen, types.GeneratorType)):
   raise TypeError(('inlineCallbacks requires %r to produce a generator; instead got %r' % (f, gen)))
  return _inlineCallbacks(None, gen, Deferred())
 return unwindGenerator

def inlineCallbacks ( f ) : @ wraps ( f ) def unwindGenerator ( * args , ** kwargs ) : try : gen = f ( * args , ** kwargs ) except _DefGen_Return : raise TypeError ( ( 'inlineCallbacks requires %r to produce a generator; insteadcaught returnValue being used in a non-generator' % ( f , ) ) ) if ( not isinstance ( gen , types . GeneratorType ) ) : raise TypeError ( ( 'inlineCallbacks requires %r to produce a generator; instead got %r' % ( f , gen ) ) ) return _inlineCallbacks ( None , gen , Deferred ( ) ) return unwindGenerator
inlinecallbacks helps you write l{deferred}-using code that looks like a regular sequential function .