Should we default to pretty print?

47 views
Skip to first unread message

Andrey Novoseltsev

unread,
Jul 17, 2024, 12:36:39 PM7/17/24
to sage-cell
I've got a question if it is possible to "hide pretty_print(True)" in the beginning of a code cell. One of the solutions would be to add another "language" like "SagePrettyPrint", but I also wonder if it would make sense to make it the default, i.e. have pretty_print(True) added to all Sage code?

This may break API calls that rely on getting plain text output back. But every upgrade of Sage potentially breaks old code...

Any thoughts?

Thank you!
Andrey

William Stein

unread,
Jul 17, 2024, 12:45:05 PM7/17/24
to Andrey Novoseltsev, sage-cell
A quick thought -- I often I copy output, and pretty print breaks copying output.    So if you do this, make it clear in the UI how to turn it off so that copying is possible.

William

--
You received this message because you are subscribed to the Google Groups "sage-cell" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sage-cell+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sage-cell/f130afce-8b77-4c86-96fc-b28bf86f8c7fn%40googlegroups.com.


--

kcrisman

unread,
Jul 18, 2024, 8:20:14 AM7/18/24
to sage-cell

I've got a question if it is possible to "hide pretty_print(True)" in the beginning of a code cell. One of the solutions would be to add another "language" like "SagePrettyPrint", but I also wonder if it would make sense to make it the default, i.e. have pretty_print(True) added to all Sage code?

This may break API calls that rely on getting plain text output back. But every upgrade of Sage potentially breaks old code...


My gut says that enough usage probably relies on plain text, which also is copyable (as William points out) says that maybe this isn't a good idea for a default.

Ideal would be something as simple as a box to click to turn this on/off when language is Sage (though I don't know how easy that would be to implement).  And then advertise :-) 
Reply all
Reply to author
Forward
0 new messages