diff --git a/IPython/core/display.py b/IPython/core/display.py index 0f78d0f..d5c3bb6 100644 --- a/IPython/core/display.py +++ b/IPython/core/display.py @@ -41,8 +41,9 @@ def display(obj, include=None, exclude=None): except for those included in this argument. """ from IPython.core.interactiveshell import InteractiveShell - format = InteractiveShell.instance().display_formatter.format - publish = InteractiveShell.instance().display_pub.publish + inst = InteractiveShell.instance() + format = inst.display_formatter.format + publish = inst.display_pub.publish format_dict = format(obj, include=include, exclude=exclude) publish('IPython.core.display.display', format_dict) diff --git a/IPython/core/displayhook.py b/IPython/core/displayhook.py index d73f865..0945653 100644 --- a/IPython/core/displayhook.py +++ b/IPython/core/displayhook.py @@ -195,13 +195,13 @@ class DisplayHook(Configurable): type. It is up to frontends to determine pick a MIME to to use and display that data in an appropriate manner. - This method only compute the format data for the object and should NOT - actually print or write that to a stream. + This method only computes the format data for the object and should + NOT actually print or write that to a stream. Parameters ---------- result : object - The Python object passed to the display hook, whose forat will be + The Python object passed to the display hook, whose format will be computed. Returns diff --git a/IPython/core/displaypub.py b/IPython/core/displaypub.py index 208143a..44b6a3e 100644 --- a/IPython/core/displaypub.py +++ b/IPython/core/displaypub.py @@ -27,6 +27,8 @@ Authors: # Imports #----------------------------------------------------------------------------- +from __future__ import print_function + from IPython.config.configurable import Configurable #----------------------------------------------------------------------------- @@ -98,7 +100,7 @@ class DisplayPublisher(Configurable): from IPython.utils import io # The default is to simply write the plain text data using io.Term. if data.has_key('text/plain'): - print >>io.Term.cout, data['text/plain'] + print(data['text/plain'], file=io.Term.cout) def publish_display_data(self, source, data, metadata=None):