def decode_object(d): if '__decode__' in d: return get_module_attr(d['__decode__'])(d['__data__']) elif '__pickled__' in d: return pickle.loads(str(d['__pickled__'])) else: return d
def decode_object(d): if '__decode__' in d: return get_module_attr(d['__decode__'])(d['__data__']) elif '__pickled__' in d: return safe_decode(d['__pickled__']) else: return d
def default_decode((cls, data)): cls = get_module_attr(cls) obj = cls.__new__(cls) obj.__dict__.update(data['__data__']) return obj