[sage-devel] Re: show() method for all sage objects

2019-05-22 Thread Simon King
Hi Eric, On 2019-05-22, Eric Gourgoulhon wrote: > According to > https://ipython.readthedocs.io/en/stable/config/integrating.html > if _repr_latex_() returns None then it falls back to repr(). So a strategy > could be to implement _repr_latex_ in SageObject (I guess all Cython > objects are in

[sage-devel] Re: show() method for all sage objects

2019-05-22 Thread Eric Gourgoulhon
Le mercredi 22 mai 2019 10:49:33 UTC+2, Eric Gourgoulhon a écrit : > > I've tested the code above and it fully solves > https://trac.sagemath.org/ticket/23330 > > PS: if someone would like to have a look, I've pushed the code to the trac branch: https://git.sagemath.org/sage.git/commit/?h=u/egour

[sage-devel] Re: show() method for all sage objects

2019-05-22 Thread Eric Gourgoulhon
Hi Simon, Le mercredi 22 mai 2019 09:15:10 UTC+2, Simon King a écrit : > > A lot of Sage objects are written in Cython. So, a potential problem of > that approach would be multiple inheritance. > > Ah yes, that's right... According to https://ipython.readthedocs.io/en/stable/config/integrat

[sage-devel] Re: show() method for all sage objects

2019-05-22 Thread Simon King
Hi Eric, On 2019-05-21, Eric Gourgoulhon wrote: > Le lundi 20 mai 2019 07:55:30 UTC+2, Kwankyu Lee a écrit : >> >> . Moreover many sage objects currently are displayed broken if typeset. >> > > In that case, a solution could be to introduce a new class, > TypesetSageObject, say, to implement _r

[sage-devel] Re: show() method for all sage objects

2019-05-21 Thread Eric Gourgoulhon
Le lundi 20 mai 2019 07:55:30 UTC+2, Kwankyu Lee a écrit : > > . Moreover many sage objects currently are displayed broken if typeset. > In that case, a solution could be to introduce a new class, TypesetSageObject, say, to implement _repr_latex_() in it and to make Sage objects that can be cor

[sage-devel] Re: show() method for all sage objects

2019-05-19 Thread Kwankyu Lee
On Sunday, May 19, 2019 at 9:50:22 PM UTC+9, Eric Gourgoulhon wrote: > > LaTeX is arguably the best way to display mathematics > I agree with this, but sage objects are not mathematics. > If one would like the plain text view of an object X instead, one can use > print(X). > So, in the Jupyt

[sage-devel] Re: show() method for all sage objects

2019-05-19 Thread Eric Gourgoulhon
Le dimanche 19 mai 2019 10:48:23 UTC+2, Volker Braun a écrit : > > > In general, I would lean more on the side of reasonable defaults (e.g. why > is %display typeset not the default in the notebook, its easier for power > users to turn it off than for novices to turn it on) than a proliferation

[sage-devel] Re: show() method for all sage objects

2019-05-19 Thread Kwankyu Lee
On Sunday, May 19, 2019 at 5:48:23 PM UTC+9, Volker Braun wrote: > > If you find yourself typing show() all the time you probably want to > change the displayhook to typeset stuff, i.e. you want "%display typeset" > in the notebook or on the command line: > > sage: m = random_matrix(ZZ, 3) > s

[sage-devel] Re: show() method for all sage objects

2019-05-19 Thread Volker Braun
If you find yourself typing show() all the time you probably want to change the displayhook to typeset stuff, i.e. you want "%display typeset" in the notebook or on the command line: sage: m = random_matrix(ZZ, 3) sage: m [12 -5 6] [ 1 -1 1] [-1 2 1] sage: %display unicode_art sage: m ⎛12 -