MCPcopy Index your code
hub / github.com/ipython/ipython / DisplayHandle

Class DisplayHandle

IPython/core/display_functions.py:309–354  ·  view source on GitHub ↗

A handle on an updatable display Call `.update(obj)` to display a new object. Call `.display(obj`) to add a new instance of this display, and update existing instances. See Also -------- :func:`display`, :func:`update_display`

Source from the content-addressed store, hash-verified

307
308
309class DisplayHandle:
310 """A handle on an updatable display
311
312 Call `.update(obj)` to display a new object.
313
314 Call `.display(obj`) to add a new instance of this display,
315 and update existing instances.
316
317 See Also
318 --------
319
320 :func:`display`, :func:`update_display`
321
322 """
323
324 def __init__(self, display_id=None):
325 if display_id is None:
326 display_id = _new_id()
327 self.display_id = display_id
328
329 def __repr__(self):
330 return "<%s display_id=%s>" % (self.__class__.__name__, self.display_id)
331
332 def display(self, obj, **kwargs):
333 """Make a new display with my id, updating existing instances.
334
335 Parameters
336 ----------
337 obj
338 object to display
339 **kwargs
340 additional keyword arguments passed to display
341 """
342 display(obj, display_id=self.display_id, **kwargs)
343
344 def update(self, obj, **kwargs):
345 """Update existing displays with my id
346
347 Parameters
348 ----------
349 obj
350 object to display
351 **kwargs
352 additional keyword arguments passed to update_display
353 """
354 update_display(obj, display_id=self.display_id, **kwargs)
355
356
357def clear_output(wait=False):

Callers 1

displayFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…