@decorator
def unicodify_strings_when_inputted(func, *args, **kwargs):
 args_as_list = list(args)
 for i in range(len(args)):
  arg = args[i]
  if (type(arg) is str):
   args_as_list[i] = unicode(arg, 'utf-8')
 for key in kwargs:
  arg = kwargs[key]
  if (type(arg) is str):
   kwargs[key] = unicode(arg, 'utf-8')
 return func(*args_as_list, **kwargs)

@ decorator def unicodify_strings_when_inputted ( func , * args , ** kwargs ) : args_as_list = list ( args ) for i in range ( len ( args ) ) : arg = args [ i ] if ( type ( arg ) is str ) : args_as_list [ i ] = unicode ( arg , 'utf-8' ) for key in kwargs : arg = kwargs [ key ] if ( type ( arg ) is str ) : kwargs [ key ] = unicode ( arg , 'utf-8' ) return func ( * args_as_list , ** kwargs )
decorator that makes sure every argument passed in that is a string-esque type is turned into a unicode object .