def cast_arg(t, val):
 if (t == 'intbool'):
  return cast_arg(bool, cast_arg(int, val))
 else:
  try:
   return t(val)
  except ValueError:
   raise ArgumentTypeError()

def cast_arg ( t , val ) : if ( t == 'intbool' ) : return cast_arg ( bool , cast_arg ( int , val ) ) else : try : return t ( val ) except ValueError : raise ArgumentTypeError ( )
attempts to call t on val .