[Scipy-svn] r3946 - trunk/scipy/sparse

scipy-svn@scip... scipy-svn@scip...
Sat Feb 16 14:13:17 CST 2008


Author: wnbell
Date: 2008-02-16 14:13:15 -0600 (Sat, 16 Feb 2008)
New Revision: 3946

Modified:
   trunk/scipy/sparse/lil.py
Log:
check that shape= is not specified when first arg is (M,N)


Modified: trunk/scipy/sparse/lil.py
===================================================================
--- trunk/scipy/sparse/lil.py	2008-02-16 19:53:19 UTC (rev 3945)
+++ trunk/scipy/sparse/lil.py	2008-02-16 20:13:15 UTC (rev 3946)
@@ -56,7 +56,7 @@
         # First get the shape
         if A is None:
             if not isshape(shape):
-                raise TypeError, "need a valid shape"
+                raise TypeError("need a valid shape")
             M, N = shape
             self.shape = (M,N)
             self.rows = numpy.empty((M,), dtype=object)
@@ -75,6 +75,8 @@
             self.data  = A.data
         elif isinstance(A,tuple):
             if isshape(A):
+                if shape is not None:
+                    raise ValueError('invalid use of shape parameter')
                 M, N = A
                 self.shape = (M,N)
                 self.rows = numpy.empty((M,), dtype=object)



More information about the Scipy-svn mailing list