##// END OF EJS Templates
Use is to compare NotImplemented
Jonathan Frederic -
Show More
@@ -117,7 +117,7 b' def display(*objs, **kwargs):'
117
117
118 # If _ipython_display_ is defined, use that to display this object. If
118 # If _ipython_display_ is defined, use that to display this object. If
119 # it returns NotImplemented, use the _repr_ logic (default).
119 # it returns NotImplemented, use the _repr_ logic (default).
120 if not hasattr(obj, '_ipython_display_') or obj._ipython_display_(**kwargs) == NotImplemented:
120 if not hasattr(obj, '_ipython_display_') or obj._ipython_display_(**kwargs) is NotImplemented:
121 if raw:
121 if raw:
122 publish_display_data('display', obj, metadata)
122 publish_display_data('display', obj, metadata)
123 else:
123 else:
@@ -243,7 +243,7 b' class DisplayHook(Configurable):'
243 if result is not None and not self.quiet():
243 if result is not None and not self.quiet():
244 # If _ipython_display_ is defined, use that to display this object. If
244 # If _ipython_display_ is defined, use that to display this object. If
245 # it returns NotImplemented, use the _repr_ logic (default).
245 # it returns NotImplemented, use the _repr_ logic (default).
246 if not hasattr(result, '_ipython_display_') or result._ipython_display_() == NotImplemented:
246 if not hasattr(result, '_ipython_display_') or result._ipython_display_() is NotImplemented:
247 self.start_displayhook()
247 self.start_displayhook()
248 self.write_output_prompt()
248 self.write_output_prompt()
249 format_dict, md_dict = self.compute_format_data(result)
249 format_dict, md_dict = self.compute_format_data(result)
General Comments 0
You need to be logged in to leave comments. Login now