On Tuesday, April 28, 2015 at 12:35:57 PM UTC-4, Martin R wrote: > > So, plot(x) would have no side effect, instead I would have to call show() > on the result? Slightly weird, but still OK for me. >
Not sure I understand, so just to clarify: The current behavior is that plot() has no side effects, and p.show() has side effects but no return value. sage: p = plot(sin) # no side effect, returns graphics object sage: p # displayhook displays graphics def f(): p = plot(sin) # no output p # no output p.show() # displays graphics, no return value pretty_print(p) # displays graphics, no return value plot(sin, show=True) # displays graphics and returns plot I'm not a fan of the show=True (typo: not do_show) optional keyword argument, but apart from that I don't want to change anything else. sage: plot(sin, show=True) # two plots since we explictly display AND the display hook hits return value Launched png viewer for Graphics object consisting of 1 graphics primitive Launched png viewer for Graphics object consisting of 1 graphics primitive -- You received this message because you are subscribed to the Google Groups "sage-devel" group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-devel+unsubscr...@googlegroups.com. To post to this group, send email to sage-devel@googlegroups.com. Visit this group at http://groups.google.com/group/sage-devel. For more options, visit https://groups.google.com/d/optout.