def sequence_to_texts(s): r = [] for obj in s: if text_type.providedBy(obj): value = obj else: value = text_type(obj) r.append(value) return r
def obj_to_texts(obj): if text_type.providedBy(obj): value = obj else: value = text_type(obj) return (value,)