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 docs, it says, about _ipython_display_, that "This method is ignored in the REPL."
However, when I open a REPL and type the following:
In [1]: classA:
...: def_ipython_display_(self):
...: print('woups')
...:
In [2]: A()
I get:
Out[4]: woups
Thus, it is not doing what the doc says. Is the doc wrong? (I expected something like <__main__.A at 0x7f4ad9bdab20>)
This looks inoffensive here, but my issue came from an object defined in some library that uses the _ipython_display_ method to display a HTML repr, so I only see <IPython.core.display.HTML object>. This object does have a correct __repr__ method implemented, so I expected to see that, as it is the case in the basic python repl.
Thanks!
I tried this with IPython 8.1.1 and 8.3.0, both gave the same result.
I tried with 7.22 and I got what I expected (_ipython_display_ was ignored).
The text was updated successfully, but these errors were encountered:
I'm going to consider it as a bug, cause it seems to be in the documentation for a reason: 56bafa1. That said, it's not entirely clear to me why wouldn't we want the REPL to use it. @Carreau? @bollwyvl? @takluyver?
Because there is not reason for a shell to not play sounds, or to display images (it just need to be implemented), iTerm2 has it's own protocol and many terminal emulators support sixel.
IPython CLI could perfectly for example display an svg on MacOS by opening quicklook.
For that we need to send all the mimetype and sometime call _ipython_display_.
In the docs, it says, about
_ipython_display_
, that "This method is ignored in the REPL."However, when I open a REPL and type the following:
I get:
Thus, it is not doing what the doc says. Is the doc wrong? (I expected something like
<__main__.A at 0x7f4ad9bdab20>
)This looks inoffensive here, but my issue came from an object defined in some library that uses the
_ipython_display_
method to display a HTML repr, so I only see<IPython.core.display.HTML object>
. This object does have a correct__repr__
method implemented, so I expected to see that, as it is the case in the basic python repl.Thanks!
I tried this with IPython 8.1.1 and 8.3.0, both gave the same result.
I tried with 7.22 and I got what I expected (
_ipython_display_
was ignored).The text was updated successfully, but these errors were encountered: