def contract(function,before,after):
	"""Create a function wraper wich test Eiffel-like contract
	
	before is a string that contain preconditions separed by ;
	after is a string that contain postconditions 
	"""
	if __debug__:		
		def mk_condition(code,text):
			lc=code.split(';')
			code_ins=''
			for i in lc:
				txt = i.strip()
				if txt : code_ins +='	assert '+ txt + ",'" + txt + "'\n"			
			return code_ins
		
		precondition = mk_condition (before,'precondition')
		postcondition = mk_condition (after, 'postcondition')
		real_function = function
		source = ("def func_contract("+ signature(function) +"):\n" +
				precondition +
			    "	result = undercontract_"+function.func_name+"("+
				callsignature(function)+")\n"+
			   	postcondition+"	return result\n")
			
		exec source
		globals()["undercontract_"+function.func_name]=function
		return func_contract
		
		
	else:
		return function
Create a function wraper wich test Eiffel-like contract
	
	before is a string that contain preconditions separed by ;
	after is a string that contain postconditions 
	
recipes/Python/81790_Using_introspectiverify_Eiffel_like/recipe-81790.py