On Friday, 16 December 2016 11:38:59 UTC-7, William Stein wrote: > > On Fri, Dec 16, 2016 at 10:29 AM, Thomas Judson <[email protected] > <javascript:>> wrote: > > The following statement prints “none” at the end of the output. I know > that it is expecting an extra argument, but I can’t see what I am missing, > > > > pretty_print(html(r"$\displaystyle\frac{dx}{dt} = %s$" % latex(f))) > > You can do this as a workaround: > > > html(r"$$\displaystyle\frac{dx}{dt} = %s$$" % latex(f)) > > However, do youwant us to change things so pretty_print(None) outputs > nothing, like sys.displayhook does? Alternatively, we could change > things so html(...) returns the empty string "" instead of returning > None. Thoughts? How are you really using this? >
The current plan for Sage is that html(something) returns HTML representation of that something. If it is by itself, the display hook will show it appropriately. If not, there is no output, but the returned expression can be used somehow (modified or combined with other HTML fragments) and displayed later. It would be really really nice to have consistency and the behaviour is also motivated by what latex(something) does. SageMathCell samples: html by itself http://sagecell.sagemath.org/?z=eJzLKMnN0VAKzs9NVShJrShR0gQANkIFxA==&lang=sage double html with the first producing a deprecation warning http://sagecell.sagemath.org/?z=eJzLKMnN0VAKzs9NVShJrShR0uTlykAXAgDbqgue&lang=sage pretty_printed double html without any warnings http://sagecell.sagemath.org/?z=eJwrKEotKamMLyjKzCvRyCjJzdFQCs7PTVUoSa0oUdLU5OUqwK8AAP8lFqg=&lang=sage Note also that pretty_print(None) DOES show None in a pretty way and that should be expected behaviour, I think, on the other hand if pretty_print is the last command and it itself returns None, then this None should not be shown. Thank you, Andrey > William > > > > > Tom > > > > -- > > You received this message because you are subscribed to the Google > Groups "sage-cloud" group. > > To unsubscribe from this group and stop receiving emails from it, send > an email to [email protected] <javascript:>. > > To view this discussion on the web visit > https://groups.google.com/d/msgid/sage-cloud/DB37FBDB-2886-4995-A832-F2C7AF53D2D1%40gmail.com. > > > > For more options, visit https://groups.google.com/d/optout. > > > > -- > > Best Regards, > William Stein > > CEO, SageMath, Inc. > -- You received this message because you are subscribed to the Google Groups "sage-cloud" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/sage-cloud/38d0c694-1607-4bb7-bbc5-2edda5ed19e0%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
