def __new__(cls, obj, encoding='UTF-8'): if is_py3k or isinstance(obj, unicode): return unicode.__new__(cls, obj) else: return unicode.__new__(cls, obj, encoding)