def runtime(f):
	"""Evaluates the given function each time it is called."""
	# get the function's name
	name = f.__name__
	# and its source code, sans decorator
	source = remove_decorators(getsource(f))
	@wraps(f)
	def wrapped(*args, **kwargs):
		# execute the function's declaration
		exec(source)
		# since the above overwrites its name in the local
		# scope we can call it here using eval
		return eval("%s(*%s, **%s)" % (name, args, kwargs))
	return wrapped
Evaluates the given function each time it is called.
recipes/Python/576751_Reevaluate_functions_when_called/recipe-576751.py