From 405c36aeb4ebae9e9f3baf39be8d12ff3f16faff 2017-05-24 21:26:09
From: Thomas Kluyver <takowl@gmail.com>
Date: 2017-05-24 21:26:09
Subject: [PATCH] Merge pull request #10593 from Carreau/typing-III

remove py2 code
---

diff --git a/IPython/lib/pretty.py b/IPython/lib/pretty.py
index c556684..4a153bd 100644
--- a/IPython/lib/pretty.py
+++ b/IPython/lib/pretty.py
@@ -484,11 +484,6 @@ class GroupQueue(object):
         except ValueError:
             pass
 
-try:
-    _baseclass_reprs = (object.__repr__, types.InstanceType.__repr__)
-except AttributeError:  # Python 3
-    _baseclass_reprs = (object.__repr__,)
-
 
 def _default_pprint(obj, p, cycle):
     """
@@ -496,7 +491,7 @@ def _default_pprint(obj, p, cycle):
     it's none of the builtin objects.
     """
     klass = _safe_getattr(obj, '__class__', None) or type(obj)
-    if _safe_getattr(klass, '__repr__', None) not in _baseclass_reprs:
+    if _safe_getattr(klass, '__repr__', None) is not object.__repr__:
         # A user-provided repr. Find newlines and replace them with p.break_()
         _repr_pprint(obj, p, cycle)
         return