#7619: Pickling support for finite word defined by callable and iterable
-----------------------------+----------------------------------------------
   Reporter:  slabbe         |       Owner:  slabbe  
       Type:  enhancement    |      Status:  new     
   Priority:  major          |   Milestone:  sage-4.3
  Component:  combinatorics  |    Keywords:          
Work_issues:                 |      Author:          
   Upstream:  N/A            |    Reviewer:          
     Merged:                 |  
-----------------------------+----------------------------------------------
 Currently pickling doesn't work for finite word defined by iterator and
 callable :

 {{{
 sage: w = Word(iter('abcdefghijkl'))
 sage: loads(dumps(w))
 Traceback (most recent call last):
 ...
 PicklingError: Can't pickle <type 'generator'>: attribute lookup
 __builtin__.generator failed
 }}}

 This is not too hard to support. One just have to expand the iterator to a
 list  (or a tuple?) and save the list instead:

 {{{
 sage: w = Word(iter('abcdefghijkl'))
 sage: loads(dumps(w))
 word: abcdefghijkl
 sage: type(_)
 <class 'sage.combinat.words.word.FiniteWord_list'>
 }}}

 This is more general solution to the problem solved in #7519.

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/7619>
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