Hi, Original author of the patch here. I took some time to look at this today and found that the doctesting bug was due to reading the value of sys.stdout only once in install(); during doctesting, sys.stdout is reset some time after install() is called, presumably to redirect output back to the doctesting mechanism.
I fixed this bug and restructured the code by moving it out of a class (since the single instance variable was no longer needed) in a new patch which I've uploaded to #1918. Unless we find any more bugs with the displayhook, the only problem that remains is that of updating the doctests where a list of matrices is output. Back when I was working on this, my approach to fixing the doctests relied upon an automatic solution. William had told me about this nifty little tool called sage -fixdoctests that looked at the output of a test run and spliced the output from the "Expected:" section back into the original source code so that it would pass the doctest. The problem was, sage -fixdoctests couldn't handle multiline output from a test case, which are exactly the types of outputs that will be affected by the displayhook. I spent some time writing a tool that could handle multiline outputs based on sage -fixdoctests, but even though it should be really simple I kept making off by one errors :). As soon as I get back home to my external HD, I can post the source of that incomplete tool. I will take a look and see if I can fix it, because I think that a fixed sage -fixdoctests would be a valuable resource to the Sage community. -- Bill On Nov 26, 3:03 am, Florent Hivert <florent.hiv...@univ-rouen.fr> wrote: > Hi there, > > I'll use the excuse that I'm now writing on a laptop in a train for not having > searched if this as already been discussed... > > Is there a limitation somewhere (apart of course the available free time of > the developers) which prevent us from improving the following ugly printing ? > > sage: m = matrix(2,2) > sage: [m, m, m] > > [[0 0] > [0 0], [0 0] > [0 0], [0 0] > [0 0]] > > Cheers, > > Florent -- To post to this group, send an email to sage-devel@googlegroups.com To unsubscribe from this group, send an email to sage-devel-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-devel URL: http://www.sagemath.org