You can clone with
HTTPS or Subversion.
Our new display system uses special methods like __html__, __latex__ to allow objects to declare their representations. We need to rethink how we want to name these methods. Soe ideas are: __repr_html__, __disp_html__, etc.
R. Kern also suggested that these special methods are used after global display functions are attempted.
I also suggest that they not use the __double_underscores__ that are reserved for the Python language itself. :-)
@ellisonbg, this is also on our immediate todo so I made it critical. We should have that protocol sorted out before release (I can also help on that).
In the spirit of "Namespaces are one honking great idea -- let's do more of those!", how about prefixing these special ipython methods with an _ipython prefix? For example, I can see Sage having some other assumptions about an __html__ method. Maybe names like _ipython_html or _ipython_latex might make sense. Or maybe collecting these methods into an _ipython_pyout dictionary or object would make sense, so that myvar._ipython_pyout['latex'] or myvar._ipython_pyout.latex would be the ipython latex-formatting function.
Or here's another idea: _ipython_repr(format='json') or _ipython_repr(format='latex')
Or, one thing that was suggested before, have a dictionary of mimetype -> method, so we could do:
This also makes it easy to replace the methods at runtime. The difficulty is that the method references in the dictionary won't be automatically bound on instantiation, so we'd have to find a neat way of handling it.
This is merged.
What is merged? Do you happen to have a link to the commit(s)?