diff options
Diffstat (limited to 'numpy/lib/utils.py')
-rw-r--r-- | numpy/lib/utils.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/numpy/lib/utils.py b/numpy/lib/utils.py index 40e13bdc3..1f1cdfc8a 100644 --- a/numpy/lib/utils.py +++ b/numpy/lib/utils.py @@ -561,7 +561,10 @@ def info(object=None,maxwidth=76,output=sys.stdout,toplevel='numpy'): methstr, other = pydoc.splitdoc(inspect.getdoc(thisobj) or "None") print(" %s -- %s" % (meth, methstr), file=output) - elif isinstance(object, types.InstanceType): ## check for __call__ method + elif (sys.version_info[0] < 3 + and isinstance(object, types.InstanceType)): + # check for __call__ method + # types.InstanceType is the type of the instances of oldstyle classes print("Instance of class: ", object.__class__.__name__, file=output) print(file=output) if hasattr(object, '__call__'): |