#13378: Do not cache the non-existence of coerce/convert map too often, and do 
not
pretend that there is a conversion where it doesn't make sense at all
----------------------------------------------------+-----------------------
       Reporter:  SimonKing                         |         Owner:  robertwb
           Type:  defect                            |        Status:  new     
       Priority:  major                             |     Milestone:  sage-5.3
      Component:  coercion                          |    Resolution:          
       Keywords:  coercion conversion object cache  |   Work issues:          
Report Upstream:  N/A                               |     Reviewers:          
        Authors:                                    |     Merged in:          
   Dependencies:                                    |      Stopgaps:          
----------------------------------------------------+-----------------------

Comment (by nbruin):

 Are you sure
 {{{
 ZZ.convert_map_from(10)
 }}}
 should not raise an error? Shouldn't the argument be a parent? Something
 like:
 {{{
     if not(isinstance(S,type) or
 isinstance(type(S),sage.structure.parent.Parent):
         raise TypeError('convert maps only exist from parents')
 }}}
 This has the potential for getting hairy if you want this to work:
 {{{
 sage: A=AdditiveGroups()
 sage: A(ZZ)
 Free commutative group on generators [1]
 }}}
 because then `parent(ZZ)` should be a Parent and it's not. However, this
 doesn't seem to be the way categories work anyway and it's probably wise
 to keep a strict separation between sets (parents) and categories. It
 actually makes me wonder if parent(ZZ) should even work.

 I know this all flies in the face of duck typing, but so does the whole
 category framework. I'm afraid that a fully duck typed computer algebra
 system would about as bad as an untyped one.

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