class NavigableString(unicode, PageElement):
def __new__(cls, value):
if isinstance(value, unicode):
return unicode.__new__(cls, value)
return unicode.__new__(cls, value, DEFAULT_OUTPUT_ENCODING)
def __getnewargs__(self):#this line
return (NavigableString.__str__(self),)
class NavigableString(unicode, PageElement): def __new__(cls, value): if isinstance(value, unicode): return unicode.__new__(cls, value) return unicode.__new__(cls,
Share
Try this:
I.e.:
__getnewargs__tellspickle.dumpsto picklexin such a way that apickle.loadsback from that string will useNavigableString.__new__with the proper argument.