diff -r c02f464dd721 Lib/_sitebuiltins.py --- a/Lib/_sitebuiltins.py Thu Sep 26 09:35:39 2013 -0700 +++ b/Lib/_sitebuiltins.py Fri Sep 27 17:09:02 2013 +0300 @@ -97,3 +97,20 @@ def __call__(self, *args, **kwds): import pydoc return pydoc.help(*args, **kwds) + + +def _displayhook(value): + """Override standard display hook to use pprint.pprint()""" + if value is None: + return + import builtins + from os import environ + from pprint import pprint + try: + width = int(environ['COLUMNS']) + except (KeyError, ValueError): + width = 80 + # Set '_' to None to avoid recursion + builtins._ = None + pprint(value, width=width) + builtins._ = value diff -r c02f464dd721 Lib/site.py --- a/Lib/site.py Thu Sep 26 09:35:39 2013 -0700 +++ b/Lib/site.py Fri Sep 27 17:09:02 2013 +0300 @@ -371,6 +371,9 @@ def sethelper(): builtins.help = _sitebuiltins._Helper() +def setdisplayhook(): + sys.displayhook = _sitebuiltins._displayhook + def enablerlcompleter(): """Enable default readline configuration on interactive prompts, by registering a sys.__interactivehook__. @@ -533,6 +536,7 @@ setquit() setcopyright() sethelper() + setdisplayhook() enablerlcompleter() aliasmbcs() execsitecustomize()