summaryrefslogtreecommitdiff
path: root/numpy/lib/utils.py
diff options
context:
space:
mode:
Diffstat (limited to 'numpy/lib/utils.py')
-rw-r--r--numpy/lib/utils.py46
1 files changed, 2 insertions, 44 deletions
diff --git a/numpy/lib/utils.py b/numpy/lib/utils.py
index 3c71d2a7c..f233c7240 100644
--- a/numpy/lib/utils.py
+++ b/numpy/lib/utils.py
@@ -1,5 +1,3 @@
-from __future__ import division, absolute_import, print_function
-
import os
import sys
import types
@@ -55,7 +53,7 @@ def _set_function_name(func, name):
return func
-class _Deprecate(object):
+class _Deprecate:
"""
Decorator class to deprecate old functions.
@@ -607,41 +605,6 @@ def info(object=None, maxwidth=76, output=sys.stdout, toplevel='numpy'):
)
print(" %s -- %s" % (meth, methstr), file=output)
- 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__'):
- arguments = formatargspec(
- *getargspec(object.__call__.__func__)
- )
- arglist = arguments.split(', ')
- if len(arglist) > 1:
- arglist[1] = "("+arglist[1]
- arguments = ", ".join(arglist[1:])
- else:
- arguments = "()"
-
- if hasattr(object, 'name'):
- name = "%s" % object.name
- else:
- name = "<name>"
- if len(name+arguments) > maxwidth:
- argstr = _split_line(name, arguments, maxwidth)
- else:
- argstr = name + arguments
-
- print(" " + argstr + "\n", file=output)
- doc = inspect.getdoc(object.__call__)
- if doc is not None:
- print(inspect.getdoc(object.__call__), file=output)
- print(inspect.getdoc(object), file=output)
-
- else:
- print(inspect.getdoc(object), file=output)
-
elif inspect.ismethod(object):
name = object.__name__
arguments = formatargspec(
@@ -869,15 +832,10 @@ def _lookfor_generate_cache(module, import_modules, regenerate):
or newly generated.
"""
- global _lookfor_caches
# Local import to speed up numpy's import time.
import inspect
- if sys.version_info[0] >= 3:
- # In Python3 stderr, stdout are text files.
- from io import StringIO
- else:
- from StringIO import StringIO
+ from io import StringIO
if module is None:
module = "numpy"