#13835: pickle_function, unpickle_function don't handle default arguments 
properly
------------------------+---------------------------------------------------
   Reporter:  cnassau   |             Owner:  was     
       Type:  defect    |            Status:  new     
   Priority:  major     |         Milestone:  sage-5.6
  Component:  pickling  |          Keywords:          
Work issues:            |   Report Upstream:  N/A     
  Reviewers:            |           Authors:          
  Merged in:            |      Dependencies:          
   Stopgaps:            |  
------------------------+---------------------------------------------------
 The following came up in ticket #13814:

 {{{#!python
    sage: f = Permutations
    sage: from sage.misc.fpickle import pickle_function, unpickle_function
    sage: g = unpickle_function(pickle_function(f))
    sage: print f(5)
    Standard permutations of 5
    sage: print g(5)
    Traceback (most recent call last):
    ...
    TypeError: Permutations() takes exactly 2 arguments (1 given)
 }}}

 Nicholas Thierry suggested to make this a separate ticket:
 > Yes, this is definitely a misfeature with sage.misc.fpickle. It should
 > be fixed to use standard pickling when it can (e.g. for a function
 > defined in a library). And it should return something that can be
 > unpickled with a plain loads. And, as mentioned in the code of family
 > it should be registered to copy_reg so that it would be called
 > automatically by dumps without needing to pollute one's code (like
 > family) with it.

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/13835>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica, 
and MATLAB

-- 
You received this message because you are subscribed to the Google Groups 
"sage-trac" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/sage-trac?hl=en.

Reply via email to