def __cacheit_debug(maxsize):
 def func_wrapper(func):
  from .decorators import wraps
  cfunc = __cacheit(maxsize)(func)
  @wraps(func)
  def wrapper(*args, **kw_args):
   r1 = func(*args, **kw_args)
   r2 = cfunc(*args, **kw_args)
   (hash(r1), hash(r2))
   if (r1 != r2):
    raise RuntimeError('Returned values are not the same')
   return r1
  return wrapper
 return func_wrapper

def __cacheit_debug ( maxsize ) : def func_wrapper ( func ) : from . decorators import wraps cfunc = __cacheit ( maxsize ) ( func ) @ wraps ( func ) def wrapper ( * args , ** kw_args ) : r1 = func ( * args , ** kw_args ) r2 = cfunc ( * args , ** kw_args ) ( hash ( r1 ) , hash ( r2 ) ) if ( r1 != r2 ) : raise RuntimeError ( 'Returned values are not the same' ) return r1 return wrapper return func_wrapper
cacheit + code to check cache consistency .