Hi Eric,

On 2019-05-22, Eric Gourgoulhon <egourgoul...@gmail.com> 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 inhereting from it) as follows:
>
>     def _repr_latex_(self):
>         from sage.misc.latex import latex
>         if not hasattr(self, '_latex_'):
>             return None
>         return '$' + str(latex(self)) + '$'

That sounds reasonable to me, and is basically what we do with Python's
magical (double underscore) methods (namely: provide a reasonable
default that shouldn't be overridden).

Best regards,
Simon

-- 
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 https://groups.google.com/group/sage-devel.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-devel/qc3lan%244di2%241%40blaine.gmane.org.
For more options, visit https://groups.google.com/d/optout.

Reply via email to