#14469: Fix _repr_ of graphics objects
----------------------------+-----------------------------------------------
       Reporter:  vbraun    |         Owner:  jason, was
           Type:  defect    |        Status:  new       
       Priority:  major     |     Milestone:  sage-5.10 
      Component:  graphics  |    Resolution:            
       Keywords:            |   Work issues:            
Report Upstream:  N/A       |     Reviewers:            
        Authors:            |     Merged in:            
   Dependencies:            |      Stopgaps:            
----------------------------+-----------------------------------------------
Description changed by vbraun:

Old description:

> Graphical output of plots (or other graphics objects) is hooked into
> `_repr_()`. Obviously, Python doesn't expect `repr` to have side effects
> so we get fun stuff like
> {{{
> sage: g = Graphics()
> sage: g?
> }}}
> showing a plot in addition to the help.
>
> This patch moves the decision logic into the displayhook, and makes
> `repr` always return a string representation as it should.
>
> Also, deprecate the `show_output()` function. Wat?

New description:

 Graphical output of plots (or other graphics objects) is hooked into
 `_repr_()`. Obviously, Python doesn't expect `repr` to have side effects
 so we get fun stuff like
 {{{
 sage: g = Graphics()
 sage: g?
 }}}
 showing a plot in addition to the help. Or `(g,g)` opening two plot output
 windows if used on the command line. You don't want to try `[g]*100`

 This patch moves the decision logic into the displayhook, and makes `repr`
 always return a string representation as it should.

 Also, deprecate the `show_output()` function. Wat?

--

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/14469#comment:1>
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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to