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)
Example #2
0
 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)
Example #3
0
 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)
Example #4
0
 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)
Example #5
0
 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)