#12048: FiniteEnumeratedSet creates elements that don't inherit from Element
---------------------------------+------------------------------------------
       Reporter:  roed           |         Owner:  sage-combinat
           Type:  defect         |        Status:  needs_work   
       Priority:  major          |     Milestone:  sage-5.1     
      Component:  combinatorics  |    Resolution:               
       Keywords:                 |   Work issues:               
Report Upstream:  N/A            |     Reviewers:               
        Authors:  David Roe      |     Merged in:               
   Dependencies:                 |      Stopgaps:               
---------------------------------+------------------------------------------

Comment (by nthiery):

 Dear David,

 Sorry for lagging so much behind on this ticket. I have finally been
 discussing with Florent, and we agreed on the following:

 - We definitely want to have facade parents in Sage whose elements
   are plain Python objects. In fact we already have some: you can
   e.g. define facade posets on strings or
   sage.structure.parent.Set_PythonType(int).

   Under many circumstances, wrapping objects sure has its advantages
   (the element can make use of the parent information for certain
   operations), but there are also many use cases where constantly
   wrapping/unwrapping is a pain.

   The worst is when a user gives a list of objects as input to
   construct some parent A (e.g. a CombinatorialFreeModule), and then
   (s)he accesses those objects from A he gets something that looks
   and smell like the original objects but differ in behavior in a
   subtle way

 - Coercion should work for those parents. It does not currently due
   to this test whether the end result of __call__ is an Element. This
   should be easy to fix. We already got hurt by that with Posets, and
   had to resort to a hand made __call__ (yuck).

 - By default, we prefer FiniteEnumeratedSets to be facades by default
   to not break backward compatibility, and also because this seems to
   be what we need most of the time (because there are barely no
   operations on the elements).


 . Now if there is a clear need for it, we could add a facade
   option to have non facade FiniteEnumeratedSets.

 What do you think? Do you feel like fixing coercion as above?

 Cheers,
                                    Nicolas

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