def __new__(cls, base=u'', encoding=None, errors='strict'): if hasattr(base, '__html__'): base = base.__html__() if encoding is None: # using class to create new object. return text_type.__new__(cls, base) #just use str.__new__ prototype return text_type.__new__(cls, base, encoding, errors)
def __new__(cls, base=u'', encoding=None, errors='strict'): if hasattr(base, '__html__'): base = base.__html__() if encoding is None: return text_type.__new__(cls, base) return text_type.__new__(cls, base, encoding, errors)
def __new__(cls, base=u"", encoding=None, errors="strict"): if hasattr(base, "__html__"): base = base.__html__() if encoding is None: return text_type.__new__(cls, base) return text_type.__new__(cls, base, encoding, errors)