def displayhook_with_ipython(self, obj):
  """Custom displayhook to display results with IPython."""
  del self
  # reproduce the behavior of the standard displayhook, not printing None
  if obj is not None:
    IPython.display.display(obj)
Custom displayhook to display results with IPython.
penzai/toolshed/patch_ipdb.py