#14984: Cannot plot functions that use mpmath if complex numbers occur in the 
image
-------------------------------+-----------------------------
       Reporter:  eviatarbach  |         Owner:
           Type:  defect       |        Status:  needs_review
       Priority:  major        |     Milestone:  sage-5.12
      Component:  numerical    |    Resolution:
       Keywords:               |     Merged in:
        Authors:               |     Reviewers:
Report Upstream:  N/A          |   Work issues:
         Branch:               |  Dependencies:
       Stopgaps:               |
-------------------------------+-----------------------------

Comment (by ppurka):

 What are the possible inputs of the `parent` keyword? For example, it will
 still crash if `parent=int` or `parent=Integer`. I think it should be
 modified to return `complex(y)` only after either doing something like
 this
 {{{
     try:
         return parent(y)
     except TypeError:
         if hasattr(parent, 'complex_field'):
             return parent.complex_field()(y)
         else:
             return complex(y)
 }}}
 or, by doing something like this:
 {{{
     try:
         return parent(y)
     except TypeError:
         try:
             return parent.complex_field()(y)
         except TypeError:
             return complex(y)
 }}}

--
Ticket URL: <http://trac.sagemath.org/ticket/14984#comment:3>
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 unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to