Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use _repr_mimebundle_ instead of _ipython_display_ message for initial display #1986

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions ipywidgets/widgets/widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -697,7 +697,7 @@ def _trait_from_json(x, self):
"""Convert json values to objects."""
return x

def _ipython_display_(self, **kwargs):
def _repr_mimebundle_(self, **kwargs):
"""Called when `IPython.display.display` is called on the widget."""
if self._view_name is not None:

Expand All @@ -715,9 +715,8 @@ def _ipython_display_(self, **kwargs):
'model_id': self._model_id
}
}
display(data, raw=True)

self._handle_displayed(**kwargs)
return data

def _send(self, msg, buffers=None):
"""Sends a message to the model in the front-end."""
Expand Down