def createMemoryWorker():
 def perform():
  if (not worker._pending):
   return False
  if (worker._pending[0] is NoMoreWork):
   return False
  worker._pending.pop(0)()
  return True
 worker = MemoryWorker()
 return (worker, perform)

def createMemoryWorker ( ) : def perform ( ) : if ( not worker . _pending ) : return False if ( worker . _pending [ 0 ] is NoMoreWork ) : return False worker . _pending . pop ( 0 ) ( ) return True worker = MemoryWorker ( ) return ( worker , perform )
create an l{iworker} that does nothing but defer work .