You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the spirit of PR #3250, which allows other projects to render IPython HTML objects, I would like to render objects from other projects implementing the __html__ method in IPython.
Can I give it a try? Or is there a reason to not support this?
Seems to me that having formatters for __*__ methods is an uncharted territory here. Having an interpretation for popular dunders which do not have an agreed upon semantics (mostly: return value / signature) seems risky.
Feels like there could be an implementation of an object that does not follow IPython's semantics with respect to such method - such object would become unusable in IPython. It's not hard for me to imagine GH issues being thrown around just to make other projects compliant with this one, and that's not a scenario that invites kindness.
Is there anything stopping you from doing obj._repr_html_ = obj.__html__, or is this just about the convenience factor of having it out of the box?
In the spirit of PR #3250, which allows other projects to render IPython HTML objects, I would like to render objects from other projects implementing the
__html__
method in IPython.Can I give it a try? Or is there a reason to not support this?
If it's fine, are there any tips? Do I just need to "copy/paste", adjust and register the
_repr_html_
formatter class in https://github.com/ipython/ipython/blob/master/IPython/core/formatters.py? If so I can send out a PR later.The text was updated successfully, but these errors were encountered: