Changes between Version 51 and Version 67 of Ticket #11115


Ignore:
Timestamp:
09/11/11 10:40:39 (3 years ago)
Author:
SimonKing
Comment:

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.

Example:

sage: type(cunningham_prime_factors) 
<type 'sage.misc.cachefunc.CachedFunction'> 
sage: loads(dumps(cunningham_prime_factors)) is cunningham_prime_factors #indirect doctest 
True 

Apply trac11115-cached_cython.patch trac11115-ElementWithCache?.patch trac11115_cached_function_pickling.patch

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #11115

    • Property Dependencies changed from sage-4.7, #9976, #11298, 11342 to sage-4.7, #9976, #11298, #11342
    • Property Work issues changed from to Pickling of cached functions
  • Ticket #11115 – Description

    v51 v67  
    4545 
    4646[attachment:trac11115-ElementWithCache.patch] 
     47 
     48[attachment:trac11115_cached_function_pickling.patch]