diff --git a/IPython/core/display.py b/IPython/core/display.py index 5cd6482..b1410c4 100644 --- a/IPython/core/display.py +++ b/IPython/core/display.py @@ -117,7 +117,7 @@ def display(*objs, **kwargs): # If _ipython_display_ is defined, use that to display this object. If # it returns NotImplemented, use the _repr_ logic (default). - if not hasattr(obj, '_ipython_display_') or obj._ipython_display_(**kwargs) == NotImplemented: + if not hasattr(obj, '_ipython_display_') or obj._ipython_display_(**kwargs) is NotImplemented: if raw: publish_display_data('display', obj, metadata) else: diff --git a/IPython/core/displayhook.py b/IPython/core/displayhook.py index 8e873ed..c7e380b 100644 --- a/IPython/core/displayhook.py +++ b/IPython/core/displayhook.py @@ -243,7 +243,7 @@ class DisplayHook(Configurable): if result is not None and not self.quiet(): # If _ipython_display_ is defined, use that to display this object. If # it returns NotImplemented, use the _repr_ logic (default). - if not hasattr(result, '_ipython_display_') or result._ipython_display_() == NotImplemented: + if not hasattr(result, '_ipython_display_') or result._ipython_display_() is NotImplemented: self.start_displayhook() self.write_output_prompt() format_dict, md_dict = self.compute_format_data(result)