#13811: LazyFamily cannot be copied if it can't be pickled
--------------------------------------------+-------------------------------
       Reporter:  cnassau                   |         Owner:  was         
           Type:  defect                    |        Status:  needs_review
       Priority:  minor                     |     Milestone:  sage-5.5    
      Component:  pickling                  |    Resolution:              
       Keywords:  LazyFamily, copy, pickle  |   Work issues:              
Report Upstream:  N/A                       |     Reviewers:              
        Authors:  Christian Nassau          |     Merged in:              
   Dependencies:                            |      Stopgaps:              
--------------------------------------------+-------------------------------

Comment (by cnassau):

 Replying to [comment:4 nthiery]:
 >     Hi Christian!
 >
 > Families are (semantically) immutable objects. Why would we want to copy
 them?

 Good point... I stumbled across this issue while I was struggling to
 create a disjoint union of a dynamically generated family of `LazyFamily`
 objects, while the ''real'' problem was that I was using closures with
 reference to a loop variable. I eventually resolved this issue, and my
 solution does not requiry any copies now. So I agree that there's no need
 to create shallow copies.

 I '''do''' think that user code can expect that `copy(any_sage_object)`
 does not throw an error. Maybe `LazyFamily.__copy__(self)` should just
 return `self`? This would be in accordance with

    {{{
    sage: copy(Integers()) is Integers()
    True
    }}}

 Cheers,
 Christian

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/13811#comment:5>
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