[Numpy-svn] r3163 - trunk/numpy/lib

numpy-svn at scipy.org numpy-svn at scipy.org
Fri Sep 15 14:48:29 CDT 2006


Author: oliphant
Date: 2006-09-15 14:48:27 -0500 (Fri, 15 Sep 2006)
New Revision: 3163

Modified:
   trunk/numpy/lib/utils.py
Log:
Clean up info(ndarray)

Modified: trunk/numpy/lib/utils.py
===================================================================
--- trunk/numpy/lib/utils.py	2006-09-15 19:31:48 UTC (rev 3162)
+++ trunk/numpy/lib/utils.py	2006-09-15 19:48:27 UTC (rev 3163)
@@ -213,7 +213,6 @@
                     thedict[modname] = moddict
     return thedict, dictlist
 
-
 def info(object=None,maxwidth=76,output=sys.stdout,toplevel='numpy'):
     """Get help information for a function, class, or module.
 
@@ -276,16 +275,16 @@
 
     elif inspect.isclass(object):
         name = object.__name__
-        if hasattr(object, '__init__'):
-            arguments = apply(inspect.formatargspec, inspect.getargspec(object.__init__.im_func))
-            arglist = arguments.split(', ')
-            if len(arglist) > 1:
-                arglist[1] = "("+arglist[1]
-                arguments = ", ".join(arglist[1:])
-            else:
-                arguments = "()"
-        else:
-            arguments = "()"
+        arguments = "()"
+        try:
+            if hasattr(object, '__init__'):
+                arguments = apply(inspect.formatargspec, inspect.getargspec(object.__init__.im_func))
+                arglist = arguments.split(', ')
+                if len(arglist) > 1:
+                    arglist[1] = "("+arglist[1]
+                    arguments = ", ".join(arglist[1:])
+        except:
+            pass
 
         if len(name+arguments) > maxwidth:
             argstr = _split_line(name, arguments, maxwidth)



More information about the Numpy-svn mailing list