def _normalize_to_caption(self, text):
        tu = isinstance(text, unicode)
        cu = isinstance(self._caption, unicode)
        if tu == cu:
            return text
        if tu:
            return text.encode('ascii') # follow python2's implicit conversion
        return text.decode('ascii')
Return text converted to the same type as self.caption
dataset/ETHPy150Open AnyMesh/anyMesh-Python/example/urwid/widget.py/Edit._normalize_to_caption