def iternext_impl(func):
 def wrapper(context, builder, sig, args):
  pair_type = sig.return_type
  pairobj = context.make_helper(builder, pair_type)
  func(context, builder, sig, args, _IternextResult(context, builder, pairobj))
  return impl_ret_borrowed(context, builder, pair_type, pairobj._getvalue())
 return wrapper

def iternext_impl ( func ) : def wrapper ( context , builder , sig , args ) : pair_type = sig . return_type pairobj = context . make_helper ( builder , pair_type ) func ( context , builder , sig , args , _IternextResult ( context , builder , pairobj ) ) return impl_ret_borrowed ( context , builder , pair_type , pairobj . _getvalue ( ) ) return wrapper
wrap the given iternext() implementation so that it gets passed an _iternextresult() object easing the returning of the iternext() result pair .