Skip to content

Add explain_pickle module; allow overriding class lookup for unpickling #5483

@sagetrac-cwitty

Description

@sagetrac-cwitty

explain_pickle is an unpickler (intended to be totally compatible with the cPickle unpickler) that produces Sage source code, which can then be evaluated by sage_eval. This is useful to see exactly how the unpickle process works. For example:

sage: explain_pickle(dumps(3))

pg_make_integer = unpickle_global('sage.rings.integer', 'make_integer')
pg_make_integer('3')
sage: explain_pickle(dumps(3), in_current_sage=True)

from sage.rings.integer import make_integer
make_integer('3')

I think the code works, but I'm not done writing documentation and doctests.

CC: @williamstein

Component: misc

Author: Carl Witty

Reviewer: Nicolas Thiery, William Stein

Merged: 4.0.1.rc0

Issue created by migration from https://trac.sagemath.org/ticket/5483

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions