##// END OF EJS Templates
Bring display of builtin types and functions in line with Py 2
Thomas Kluyver -
Show More
@@ -103,7 +103,6 b' Inheritance diagram:'
103 Portions (c) 2009 by Robert Kern.
103 Portions (c) 2009 by Robert Kern.
104 :license: BSD License.
104 :license: BSD License.
105 """
105 """
106 from __future__ import with_statement
107 from contextlib import contextmanager
106 from contextlib import contextmanager
108 import sys
107 import sys
109 import types
108 import types
@@ -658,7 +657,7 b' def _type_pprint(obj, p, cycle):'
658 # and others may set it to None.
657 # and others may set it to None.
659 return p.text(obj.__name__)
658 return p.text(obj.__name__)
660
659
661 if mod in ('__builtin__', 'exceptions'):
660 if mod in ('__builtin__', 'builtins', 'exceptions'):
662 name = obj.__name__
661 name = obj.__name__
663 else:
662 else:
664 name = mod + '.' + obj.__name__
663 name = mod + '.' + obj.__name__
@@ -672,7 +671,7 b' def _repr_pprint(obj, p, cycle):'
672
671
673 def _function_pprint(obj, p, cycle):
672 def _function_pprint(obj, p, cycle):
674 """Base pprint for all functions and builtin functions."""
673 """Base pprint for all functions and builtin functions."""
675 if obj.__module__ in ('__builtin__', 'exceptions') or not obj.__module__:
674 if obj.__module__ in ('__builtin__', 'builtins', 'exceptions') or not obj.__module__:
676 name = obj.__name__
675 name = obj.__name__
677 else:
676 else:
678 name = obj.__module__ + '.' + obj.__name__
677 name = obj.__module__ + '.' + obj.__name__
General Comments 0
You need to be logged in to leave comments. Login now