The problem was easy to solve: The new __reduce__ method of cached functions returns an unpickling function, together with the module and the name of the cached function. The unpickling function can re-import the cached function from these data.
sage: loads(dumps(cunningham_prime_factors)) is cunningham_prime_factors #indirect doctest
Apply trac11115-cached_cython.patch trac11115-ElementWithCache?.patch trac11115_cached_function_pickling.patch
Powered by Trac 0.12
By Edgewall Software.
Visit the Trac open source project athttp://trac.edgewall.org/