def cast_to_a1_notation(method):
 @wraps(method)
 def wrapper(self, *args, **kwargs):
  try:
   if len(args):
    int(args[0])
   range_start = rowcol_to_a1(*args[:2])
   range_end = rowcol_to_a1(*args[(-2):])
   range_name = ':'.join((range_start, range_end))
   args = ((range_name,) + args[4:])
  except ValueError:
   pass
  return method(self, *args, **kwargs)
 return wrapper

def cast_to_a1_notation ( method ) : @ wraps ( method ) def wrapper ( self , * args , ** kwargs ) : try : if len ( args ) : int ( args [ 0 ] ) range_start = rowcol_to_a1 ( * args [ : 2 ] ) range_end = rowcol_to_a1 ( * args [ ( - 2 ) : ] ) range_name = ':' . join ( ( range_start , range_end ) ) args = ( ( range_name , ) + args [ 4 : ] ) except ValueError : pass return method ( self , * args , ** kwargs ) return wrapper
decorator function casts wrapped arguments to a1 notation in range method calls .