#5538: [with patch; needs review] Family does copy its input + various
improvement.
---------------------------+------------------------------------------------
 Reporter:  hivert         |       Owner:  hivert               
     Type:  defect         |      Status:  new                  
 Priority:  major          |   Milestone:  sage-3.4.2           
Component:  combinatorics  |    Keywords:  Family, mutable input
---------------------------+------------------------------------------------

Old description:

> When family got a dictionary it does not copy it's input so that one can
> modify it. One should use a kind of frozen dictionary.
> {{{
> sage: d = {1:"a", 3:"b", 4:"c"}
> sage: f = Family(d)
> sage: f
> Finite family {1: 'a', 3: 'b', 4: 'c'}
> sage: d.
> sage: d[2] = 'DD'
> sage: d
> {1: 'a', 2: 'DD', 3: 'b', 4: 'c'}
> sage: f
> Finite family {1: 'a', 2: 'DD', 3: 'b', 4: 'c'}
> }}}
>
> Florent

New description:

 When family got a dictionary it does not copy it's input so that one can
 modify it. Before the patch we had the following wrong behavior:
 {{{
 sage: d = {1:"a", 3:"b", 4:"c"}
 sage: f = Family(d); f
 Finite family {1: 'a', 3: 'b', 4: 'c'}
 sage: d[2] = 'DD'
 sage: f
 Finite family {1: 'a', 2: 'DD', 3: 'b', 4: 'c'}
 }}}
 This is now corrected.

 The second improvement is that list, and tuple can now be transformed to
 family indexed by `0..n` with the class TrivialFamily;

 The third improvement is that FiniteCombinatorialClass is now fully
 compatible with family.

 A Fourth improvement is that for lazy family the pickling of the  function
 or the attrcall is done as far as possible. And example of a case where it
 is not possible to work has been added.

 Finally since family has noting to do with combinatorics, I moved this to
 the more sensible sage.set.

 Author: Florent Hivert

--

Comment(by hivert):

 Since the file is moved, the patch is not very useful. I added a diff from
 the former {{{sage/combinat/family.py}}} to the new
 {{{sage/sets/family.py}}}. It is *not* a patch and should not be applied.

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/5538#comment:3>
Sage <http://sagemath.org/>
Sage - Open Source Mathematical Software: Building the Car Instead of 
Reinventing the Wheel

--~--~---------~--~----~------------~-------~--~----~
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