On 2014-11-22 13:51, Volker Braun wrote:
IPython colorizes the tracebacks (at least by default, unless you turn
it off) and adds the source line for command-line input. I think
unpreparsing could easily be added on top of that:
Of course it *could* be done (assuming upstream accepts it of course)
but then you're essentially forced to tie (un)preparsing closer to
IPython. I doubt that this is the right thing to do. This would mean
that load() and attach() should also be implemented in IPython.
I agree that the whole evaluating-sage-code-from-string (or file) should
be handled in a single place (SPOT = single point of truth). I think
IPython's design is a bit smarter here: Use the existing (in Python's
traceback.linecache) line cache to store the source context. And since
IPython already implements that why not use it?
I agree that linecache is probably the right thing to use (although I
have no idea how to use linecache to store data not coming from a file).
But if it's just a one-liner to use the linecache library, we don't lose
much by reimplementing it in Sage. It's not reinventing the wheel, it's
using the wheel library.
--
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.