We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Extend sage.misc.fpickle.pyx with a PicklableFunction class wrapping interactively defined (simple) functions to make them picklable:
sage: f = lambda x: x^2 sage: loads(dumps(f)) ------------------------------------------------------------ Traceback (most recent call last): File "<ipython console>", line 1, in <module> File "sage_object.pyx", line 792, in sage.structure.sage_object.dumps (sage/structure/sage_object.c:8357) PicklingError: Can't pickle <type 'function'>: attribute lookup __builtin__.function failed sage: f = PicklableFunction(f) sage: f(3) 9 sage: f == loads(dumps(f)) True
CC: @sagetrac-sage-combinat
Component: pickling
Keywords: lambda, interactively defined functions
Issue created by migration from https://trac.sagemath.org/ticket/8561
The text was updated successfully, but these errors were encountered:
See #11845 for some code in this direction and for warnings why this should never be allowed in "standard" pickles.
Sorry, something went wrong.
nthiery
No branches or pull requests
Extend sage.misc.fpickle.pyx with a PicklableFunction class wrapping
interactively defined (simple) functions to make them picklable:
CC: @sagetrac-sage-combinat
Component: pickling
Keywords: lambda, interactively defined functions
Issue created by migration from https://trac.sagemath.org/ticket/8561
The text was updated successfully, but these errors were encountered: