def deep_force_unicode(value):
 if isinstance(value, (list, tuple, set)):
  value = type(value)(map(deep_force_unicode, value))
 elif isinstance(value, dict):
  value = type(value)(map(deep_force_unicode, value.items()))
 elif isinstance(value, Promise):
  value = force_text(value)
 return value

def deep_force_unicode ( value ) : if isinstance ( value , ( list , tuple , set ) ) : value = type ( value ) ( map ( deep_force_unicode , value ) ) elif isinstance ( value , dict ) : value = type ( value ) ( map ( deep_force_unicode , value . items ( ) ) ) elif isinstance ( value , Promise ) : value = force_text ( value ) return value
recursively call force_text on value .