def code_version(version):
 if (not isinstance(version, tuple)):
  raise TypeError('version must be tuple', version)
 def deco(f):
  f.code_version = version
  return f
 return deco

def code_version ( version ) : if ( not isinstance ( version , tuple ) ) : raise TypeError ( 'version must be tuple' , version ) def deco ( f ) : f . code_version = version return f return deco
decorator to support version-based cache mechanism .