@dual_decorator
def empty_arg_shortcircuit(return_code=u'[]', position=1):
 @decorator
 def wrapper(function, *args, **kw):
  if (len(args[position]) == 0):
   return ast.literal_eval(return_code)
  else:
   return function(*args, **kw)
 return wrapper

@ dual_decorator def empty_arg_shortcircuit ( return_code = u'[]' , position = 1 ) : @ decorator def wrapper ( function , * args , ** kw ) : if ( len ( args [ position ] ) == 0 ) : return ast . literal_eval ( return_code ) else : return function ( * args , ** kw ) return wrapper
decorate a function to shortcircuit and return something immediately if the length of a positional arg is 0 .