def __new__(cls, name, value): kwds = {'defects': []} cls.parse(value, kwds) if utils._has_surrogates(kwds['decoded']): kwds['decoded'] = utils._sanitize(kwds['decoded']) self = str.__new__(cls, kwds['decoded']) # del kwds['decoded'] self.init(name, **kwds) return self
def _reconstruct(cls, value): return str.__new__(cls, value)