def smart_text(s, encoding='utf-8', strings_only=False, errors='strict'):
 if isinstance(s, Promise):
  return s
 return force_text(s, encoding, strings_only, errors)

def smart_text ( s , encoding = 'utf-8' , strings_only = False , errors = 'strict' ) : if isinstance ( s , Promise ) : return s return force_text ( s , encoding , strings_only , errors )
returns a text object representing s -- unicode on python 2 and str on python 3 .