#12941: Cache should be cleared on cloning
----------------------------------------+-----------------------------------
       Reporter:  hivert                |         Owner:  hivert  
           Type:  defect                |        Status:  new     
       Priority:  major                 |     Milestone:  sage-5.1
      Component:  combinatorics         |    Resolution:          
       Keywords:  Clone, cache, days38  |   Work issues:          
Report Upstream:  N/A                   |     Reviewers:          
        Authors:  Florent Hivert        |     Merged in:          
   Dependencies:                        |      Stopgaps:          
----------------------------------------+-----------------------------------

Comment (by mjo):

 Replying to [comment:3 hivert]:
 > I think that in {{{Element}}} method {{{__copy__}}} line 427 (sage
 5.0rc0) the
 > following line...
 > Should be fixed not to copy cached methods
 [[BR]]
 But this affects all of the mutable classes in which caching is handled
 correctly. If instances of `Bar` are mutable and invalidate the cache when
 modified, why shouldn't a `b = Bar(); copy(b)` also copy the cache?

 This only helps in a very specific case (immutable superclass with no
 cached methods and mutable copies), and even then only when a bug actually
 exists in the subclass. Trying to predict everything that subclasses might
 do wrong within the superclass is the path to unhappiness (and breaks
 encapsulation) =)

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