parameters: (fun)
return_statement: return wrap
docstring: Decorator: let a function cache its results, use like this::
  
  		@run_once
  		def foo(k):
  			return 345*2343
  
  	.. note:: in practice this can cause memory leaks, prefer a :py:class:`waflib.Utils.lru_cache`
  
  	:param fun: function to execute
  	:type fun: function
  	:return: the return value of the function executed
docstring_summary: Decorator: let a function cache its results, use like this::
docstring_tokens: Decorator : let a function cache its results use like this ::
function: def run_once(fun):
  	"""
  	Decorator: let a function cache its results, use like this::
  
  		@run_once
  		def foo(k):
  			return 345*2343
  
  	.. note:: in practice this can cause memory leaks, prefer a :py:class:`waflib.Utils.lru_cache`
  
  	:param fun: function to execute
  	:type fun: function
  	:return: the return value of the function executed
  	"""
  	cache = {}
  	def wrap(*k):
  		try:
  			return cache[k]
  		except KeyError:
  			ret = fun(*k)
  			cache[k] = ret
  			return ret
  	wrap.__cache__ = cache
  	wrap.__name__ = fun.__name__
  	return wrap
function_tokens: def run_once ( fun ) : cache = { } def wrap ( * k ) : try : return cache [ k ] except KeyError : ret = fun ( * k ) cache [ k ] = ret return ret wrap . __cache__ = cache wrap . __name__ = fun . __name__ return wrap