[Numpy-svn] r4451 - in branches/numpy.scons: . numpy numpy/core numpy/core/blasdot numpy/core/code_generators numpy/core/include/numpy numpy/core/src numpy/core/tests numpy/distutils numpy/distutils/command numpy/distutils/fcompiler numpy/distutils/tests numpy/distutils/tests/f2py_ext/tests numpy/distutils/tests/f2py_f90_ext/tests numpy/distutils/tests/gen_ext/tests numpy/distutils/tests/pyrex_ext/tests numpy/distutils/tests/swig_ext/tests numpy/doc numpy/f2py numpy/f2py/doc numpy/f2py/lib numpy/f2py/lib/extgen numpy/f2py/lib/parser numpy/f2py/lib/tests numpy/f2py/tests/mixed numpy/fft/tests numpy/lib numpy/lib/tests numpy/linalg numpy/linalg/lapack_lite numpy/numarray numpy/oldnumeric numpy/random/tests numpy/testing numpy/tests

numpy-svn@scip... numpy-svn@scip...
Tue Nov 13 07:53:34 CST 2007


Author: cdavid
Date: 2007-11-13 07:51:35 -0600 (Tue, 13 Nov 2007)
New Revision: 4451

Added:
   branches/numpy.scons/setup.py
   branches/numpy.scons/setupscons.py
Removed:
   branches/numpy.scons/scipy_compatibility
   branches/numpy.scons/setup.old.py
   branches/numpy.scons/setup.py
Modified:
   branches/numpy.scons/TEST_COMMIT
   branches/numpy.scons/numpy/core/blasdot/_dotblas.c
   branches/numpy.scons/numpy/core/code_generators/generate_umath.py
   branches/numpy.scons/numpy/core/defchararray.py
   branches/numpy.scons/numpy/core/defmatrix.py
   branches/numpy.scons/numpy/core/fromnumeric.py
   branches/numpy.scons/numpy/core/include/numpy/ndarrayobject.h
   branches/numpy.scons/numpy/core/ma.py
   branches/numpy.scons/numpy/core/memmap.py
   branches/numpy.scons/numpy/core/numeric.py
   branches/numpy.scons/numpy/core/records.py
   branches/numpy.scons/numpy/core/setup.py
   branches/numpy.scons/numpy/core/src/arraytypes.inc.src
   branches/numpy.scons/numpy/core/src/multiarraymodule.c
   branches/numpy.scons/numpy/core/src/scalartypes.inc.src
   branches/numpy.scons/numpy/core/src/ucsnarrow.c
   branches/numpy.scons/numpy/core/src/ufuncobject.c
   branches/numpy.scons/numpy/core/tests/test_defmatrix.py
   branches/numpy.scons/numpy/core/tests/test_errstate.py
   branches/numpy.scons/numpy/core/tests/test_ma.py
   branches/numpy.scons/numpy/core/tests/test_multiarray.py
   branches/numpy.scons/numpy/core/tests/test_numeric.py
   branches/numpy.scons/numpy/core/tests/test_numerictypes.py
   branches/numpy.scons/numpy/core/tests/test_records.py
   branches/numpy.scons/numpy/core/tests/test_scalarmath.py
   branches/numpy.scons/numpy/core/tests/test_umath.py
   branches/numpy.scons/numpy/distutils/__init__.py
   branches/numpy.scons/numpy/distutils/ccompiler.py
   branches/numpy.scons/numpy/distutils/command/build_ext.py
   branches/numpy.scons/numpy/distutils/command/build_src.py
   branches/numpy.scons/numpy/distutils/command/config.py
   branches/numpy.scons/numpy/distutils/core.py
   branches/numpy.scons/numpy/distutils/cpuinfo.py
   branches/numpy.scons/numpy/distutils/fcompiler/__init__.py
   branches/numpy.scons/numpy/distutils/fcompiler/gnu.py
   branches/numpy.scons/numpy/distutils/misc_util.py
   branches/numpy.scons/numpy/distutils/system_info.py
   branches/numpy.scons/numpy/distutils/tests/f2py_ext/tests/test_fib2.py
   branches/numpy.scons/numpy/distutils/tests/f2py_f90_ext/tests/test_foo.py
   branches/numpy.scons/numpy/distutils/tests/gen_ext/tests/test_fib3.py
   branches/numpy.scons/numpy/distutils/tests/pyrex_ext/tests/test_primes.py
   branches/numpy.scons/numpy/distutils/tests/swig_ext/tests/test_example.py
   branches/numpy.scons/numpy/distutils/tests/swig_ext/tests/test_example2.py
   branches/numpy.scons/numpy/distutils/tests/test_fcompiler_gnu.py
   branches/numpy.scons/numpy/distutils/tests/test_misc_util.py
   branches/numpy.scons/numpy/doc/CAPI.txt
   branches/numpy.scons/numpy/doc/DISTUTILS.txt
   branches/numpy.scons/numpy/doc/HOWTO_DOCUMENT.txt
   branches/numpy.scons/numpy/doc/example.py
   branches/numpy.scons/numpy/doc/pep_buffer.txt
   branches/numpy.scons/numpy/doc/records.txt
   branches/numpy.scons/numpy/doc/ufuncs.txt
   branches/numpy.scons/numpy/f2py/auxfuncs.py
   branches/numpy.scons/numpy/f2py/capi_maps.py
   branches/numpy.scons/numpy/f2py/cb_rules.py
   branches/numpy.scons/numpy/f2py/common_rules.py
   branches/numpy.scons/numpy/f2py/crackfortran.py
   branches/numpy.scons/numpy/f2py/doc/collectinput.py
   branches/numpy.scons/numpy/f2py/f2py2e.py
   branches/numpy.scons/numpy/f2py/f90mod_rules.py
   branches/numpy.scons/numpy/f2py/func2subr.py
   branches/numpy.scons/numpy/f2py/lib/extgen/base.py
   branches/numpy.scons/numpy/f2py/lib/extgen/c_support.py
   branches/numpy.scons/numpy/f2py/lib/extgen/py_support.py
   branches/numpy.scons/numpy/f2py/lib/extgen/setup_py.py
   branches/numpy.scons/numpy/f2py/lib/extgen/utils.py
   branches/numpy.scons/numpy/f2py/lib/main.py
   branches/numpy.scons/numpy/f2py/lib/parser/test_Fortran2003.py
   branches/numpy.scons/numpy/f2py/lib/parser/test_parser.py
   branches/numpy.scons/numpy/f2py/lib/py_wrap_type.py
   branches/numpy.scons/numpy/f2py/lib/tests/test_derived_scalar.py
   branches/numpy.scons/numpy/f2py/lib/tests/test_module_module.py
   branches/numpy.scons/numpy/f2py/lib/tests/test_module_scalar.py
   branches/numpy.scons/numpy/f2py/lib/tests/test_scalar_function_in.py
   branches/numpy.scons/numpy/f2py/lib/tests/test_scalar_in_out.py
   branches/numpy.scons/numpy/f2py/rules.py
   branches/numpy.scons/numpy/f2py/tests/mixed/run.py
   branches/numpy.scons/numpy/f2py/use_rules.py
   branches/numpy.scons/numpy/fft/tests/test_fftpack.py
   branches/numpy.scons/numpy/fft/tests/test_helper.py
   branches/numpy.scons/numpy/lib/function_base.py
   branches/numpy.scons/numpy/lib/index_tricks.py
   branches/numpy.scons/numpy/lib/shape_base.py
   branches/numpy.scons/numpy/lib/tests/test_arraysetops.py
   branches/numpy.scons/numpy/lib/tests/test_function_base.py
   branches/numpy.scons/numpy/lib/tests/test_getlimits.py
   branches/numpy.scons/numpy/lib/tests/test_index_tricks.py
   branches/numpy.scons/numpy/lib/tests/test_polynomial.py
   branches/numpy.scons/numpy/lib/tests/test_shape_base.py
   branches/numpy.scons/numpy/lib/tests/test_twodim_base.py
   branches/numpy.scons/numpy/lib/tests/test_type_check.py
   branches/numpy.scons/numpy/lib/tests/test_ufunclike.py
   branches/numpy.scons/numpy/lib/twodim_base.py
   branches/numpy.scons/numpy/lib/type_check.py
   branches/numpy.scons/numpy/lib/utils.py
   branches/numpy.scons/numpy/linalg/SConstruct
   branches/numpy.scons/numpy/linalg/lapack_lite/clapack_scrub.py
   branches/numpy.scons/numpy/linalg/lapack_lite/make_lite.py
   branches/numpy.scons/numpy/linalg/lapack_litemodule.c
   branches/numpy.scons/numpy/matlib.py
   branches/numpy.scons/numpy/numarray/image.py
   branches/numpy.scons/numpy/numarray/matrix.py
   branches/numpy.scons/numpy/numarray/numerictypes.py
   branches/numpy.scons/numpy/oldnumeric/arrayfns.py
   branches/numpy.scons/numpy/oldnumeric/ma.py
   branches/numpy.scons/numpy/oldnumeric/matrix.py
   branches/numpy.scons/numpy/oldnumeric/precision.py
   branches/numpy.scons/numpy/oldnumeric/random_array.py
   branches/numpy.scons/numpy/random/tests/test_random.py
   branches/numpy.scons/numpy/testing/numpytest.py
   branches/numpy.scons/numpy/tests/test_ctypeslib.py
   branches/numpy.scons/numpy/version.py
   branches/numpy.scons/test.sh
Log:
Merge back from trunk, update make numpy.linalg sconscript work

Modified: branches/numpy.scons/TEST_COMMIT
===================================================================
--- branches/numpy.scons/TEST_COMMIT	2007-11-13 13:10:59 UTC (rev 4450)
+++ branches/numpy.scons/TEST_COMMIT	2007-11-13 13:51:35 UTC (rev 4451)
@@ -2,7 +2,7 @@
 rkern: yes
 pearu: yes
 fperez: yes
-chanley: yes - still
+chanley: yes
 cookedm: yes
 swalton: yes
 eric: yes

Modified: branches/numpy.scons/numpy/core/blasdot/_dotblas.c
===================================================================
--- branches/numpy.scons/numpy/core/blasdot/_dotblas.c	2007-11-13 13:10:59 UTC (rev 4450)
+++ branches/numpy.scons/numpy/core/blasdot/_dotblas.c	2007-11-13 13:51:35 UTC (rev 4451)
@@ -20,7 +20,8 @@
     register int nb = strideb / sizeof(float);
 
     if ((sizeof(float) * na == stridea) &&
-	(sizeof(float) * nb == strideb))
+	(sizeof(float) * nb == strideb) &&
+	(na >= 0) && (nb >= 0))
 	    *((float *)res) = cblas_sdot((int)n, (float *)a, na, (float *)b, nb);
 
     else
@@ -35,7 +36,8 @@
     register int nb = strideb / sizeof(double);
 
     if ((sizeof(double) * na == stridea) &&
-	(sizeof(double) * nb == strideb))
+	(sizeof(double) * nb == strideb) &&
+	(na >= 0) && (nb >= 0))
 	    *((double *)res) = cblas_ddot((int)n, (double *)a, na, (double *)b, nb);
     else
 	    oldFunctions[PyArray_DOUBLE](a, stridea, b, strideb, res, n, tmp);
@@ -50,7 +52,8 @@
     register int nb = strideb / sizeof(cfloat);
 
     if ((sizeof(cfloat) * na == stridea) &&
-	(sizeof(cfloat) * nb == strideb))
+	(sizeof(cfloat) * nb == strideb) &&
+	(na >= 0) && (nb >= 0))
 	    cblas_cdotu_sub((int)n, (float *)a, na, (float *)b, nb, (float *)res);
     else
 	    oldFunctions[PyArray_CFLOAT](a, stridea, b, strideb, res, n, tmp);
@@ -64,7 +67,8 @@
     register int nb = strideb / sizeof(cdouble);
 
     if ((sizeof(cdouble) * na == stridea) &&
-	(sizeof(cdouble) * nb == strideb))
+	(sizeof(cdouble) * nb == strideb) &&
+	(na >= 0) && (nb >= 0))
 	    cblas_zdotu_sub((int)n, (double *)a, na, (double *)b, nb, (double *)res);
     else
 	    oldFunctions[PyArray_CDOUBLE](a, stridea, b, strideb, res, n, tmp);
@@ -172,6 +176,21 @@
 }
 
 
+static int
+_bad_strides(PyArrayObject *ap)
+{
+    register int itemsize = PyArray_ITEMSIZE(ap);
+    register int i, N=PyArray_NDIM(ap);
+    register intp *strides = PyArray_STRIDES(ap);
+
+    for (i=0; i<N; i++) {
+	if ((strides[i] < 0) || (strides[i] % itemsize) != 0) 
+	    return 1;
+    }
+
+    return 0;  
+}
+
 static char doc_matrixproduct[] = "dot(a,b)\nReturns the dot product of a and b for arrays of floating point types.\nLike the generic numpy equivalent the product sum is over\nthe last dimension of a and the second-to-last dimension of b.\nNB: The first argument is not conjugated.";
 
 static PyObject *
@@ -216,8 +235,10 @@
     ap2 = (PyArrayObject *)PyArray_FromAny(op2, dtype, 0, 0, ALIGNED, NULL);
     if (ap2 == NULL) goto fail;
 
+
     if ((ap1->nd > 2) || (ap2->nd > 2)) {
-	/* This function doesn't handle dimensions greater than 2 -- other
+	/* This function doesn't handle dimensions greater than 2 
+	   (or negative striding)  -- other
 	   than to ensure the dot function is altered
 	*/
 	if (!altered) {
@@ -235,13 +256,13 @@
 	return PyArray_Return(ret);
     }
 
-    if (!PyArray_ElementStrides((PyObject *)ap1)) {
+    if (_bad_strides(ap1)) {
 	    op1 = PyArray_NewCopy(ap1, PyArray_ANYORDER);
 	    Py_DECREF(ap1);
 	    ap1 = (PyArrayObject *)op1;
 	    if (ap1 == NULL) goto fail;
     }
-    if (!PyArray_ElementStrides((PyObject *)ap2)) {
+    if (_bad_strides(ap2)) {
 	    op2 = PyArray_NewCopy(ap2, PyArray_ANYORDER);
 	    Py_DECREF(ap2);
 	    ap2 = (PyArrayObject *)op2;

Modified: branches/numpy.scons/numpy/core/code_generators/generate_umath.py
===================================================================
--- branches/numpy.scons/numpy/core/code_generators/generate_umath.py	2007-11-13 13:10:59 UTC (rev 4450)
+++ branches/numpy.scons/numpy/core/code_generators/generate_umath.py	2007-11-13 13:51:35 UTC (rev 4451)
@@ -1,4 +1,3 @@
-import string
 import re
 
 Zero = "PyUFunc_Zero"
@@ -484,7 +483,7 @@
 
 def indent(st,spaces):
     indention = ' '*spaces
-    indented = indention + string.replace(st,'\n','\n'+indention)
+    indented = indention + st.replace('\n','\n'+indention)
     # trim off any trailing spaces
     indented = re.sub(r' +$',r'',indented)
     return indented

Modified: branches/numpy.scons/numpy/core/defchararray.py
===================================================================
--- branches/numpy.scons/numpy/core/defchararray.py	2007-11-13 13:10:59 UTC (rev 4450)
+++ branches/numpy.scons/numpy/core/defchararray.py	2007-11-13 13:51:35 UTC (rev 4451)
@@ -1,7 +1,7 @@
+import sys
 from numerictypes import string_, unicode_, integer, object_
 from numeric import ndarray, broadcast, empty, compare_chararrays
 from numeric import array as narray
-import sys
 
 __all__ = ['chararray']
 

Modified: branches/numpy.scons/numpy/core/defmatrix.py
===================================================================
--- branches/numpy.scons/numpy/core/defmatrix.py	2007-11-13 13:10:59 UTC (rev 4450)
+++ branches/numpy.scons/numpy/core/defmatrix.py	2007-11-13 13:51:35 UTC (rev 4451)
@@ -1,9 +1,8 @@
 __all__ = ['matrix', 'bmat', 'mat', 'asmatrix']
 
+import sys
 import numeric as N
 from numeric import concatenate, isscalar, binary_repr
-import string as str_
-import sys
 
 # make translation table
 _table = [None]*256
@@ -11,8 +10,7 @@
     _table[k] = chr(k)
 _table = ''.join(_table)
 
-_numchars = str_.digits + ".-+jeEL"
-del str_
+_numchars = '0123456789.-+jeEL'
 _todelete = []
 for k in _table:
     if k not in _numchars:

Modified: branches/numpy.scons/numpy/core/fromnumeric.py
===================================================================
--- branches/numpy.scons/numpy/core/fromnumeric.py	2007-11-13 13:10:59 UTC (rev 4450)
+++ branches/numpy.scons/numpy/core/fromnumeric.py	2007-11-13 13:51:35 UTC (rev 4451)
@@ -35,7 +35,7 @@
     except AttributeError:
         wrap = None
     result = getattr(asarray(obj),method)(*args, **kwds)
-    if wrap and isinstance(result, mu.ndarray):
+    if wrap:
         if not isinstance(result, mu.ndarray):
             result = asarray(result)
         result = wrap(result)

Modified: branches/numpy.scons/numpy/core/include/numpy/ndarrayobject.h
===================================================================
--- branches/numpy.scons/numpy/core/include/numpy/ndarrayobject.h	2007-11-13 13:10:59 UTC (rev 4450)
+++ branches/numpy.scons/numpy/core/include/numpy/ndarrayobject.h	2007-11-13 13:51:35 UTC (rev 4451)
@@ -1283,7 +1283,7 @@
    and WRITEABLE. */
 #define NPY_ENSURECOPY    0x0020
 
-/* Make sure the returned array is an ndarray or a bigndarray */
+/* Make sure the returned array is a base-class ndarray */
 #define NPY_ENSUREARRAY   0x0040
 
 /* Make sure that the strides are in units of the element size

Modified: branches/numpy.scons/numpy/core/ma.py
===================================================================
--- branches/numpy.scons/numpy/core/ma.py	2007-11-13 13:10:59 UTC (rev 4450)
+++ branches/numpy.scons/numpy/core/ma.py	2007-11-13 13:51:35 UTC (rev 4451)
@@ -396,19 +396,20 @@
                 m = make_mask(m, copy=1)
                 m.shape = (1,)
         if m is nomask:
-            return masked_array (self.f.reduce (t, axis))
+            t = self.f.reduce(t, axis)
         else:
             t = masked_array (t, m)
             # XXX: "or t.dtype" below is a workaround for what appears
             # XXX: to be a bug in reduce.
-            t = self.f.reduce(filled(t, self.filly), axis, dtype=dtype or t.dtype)
+            t = self.f.reduce(filled(t, self.filly), axis,
+                              dtype=dtype or t.dtype)
             m = umath.logical_and.reduce(m, axis)
-            if isinstance(t, ndarray):
-                return masked_array(t, m, get_fill_value(target))
-            elif m:
-                return masked
-            else:
-                return t
+        if isinstance(t, ndarray):
+            return masked_array(t, m, get_fill_value(target))
+        elif m:
+            return masked
+        else:
+            return t
 
     def outer (self, a, b):
         "Return the function applied to the outer product of a and b."

Modified: branches/numpy.scons/numpy/core/memmap.py
===================================================================
--- branches/numpy.scons/numpy/core/memmap.py	2007-11-13 13:10:59 UTC (rev 4450)
+++ branches/numpy.scons/numpy/core/memmap.py	2007-11-13 13:51:35 UTC (rev 4451)
@@ -100,5 +100,4 @@
         try:
             self.close()
         except ValueError:
-            pass            
-        
+            pass

Modified: branches/numpy.scons/numpy/core/numeric.py
===================================================================
--- branches/numpy.scons/numpy/core/numeric.py	2007-11-13 13:10:59 UTC (rev 4450)
+++ branches/numpy.scons/numpy/core/numeric.py	2007-11-13 13:51:35 UTC (rev 4451)
@@ -658,8 +658,8 @@
     dtype - the data-type of the resulting array.  If this is a
     record data-type, the the resulting array will be 1-d and each row will
     be interpreted as an element of the array. The number of columns
-    used must match the number of fields in the data-type in this case. 
-    
+    used must match the number of fields in the data-type in this case.
+
     comments - the character used to indicate the start of a comment
     in the file
 
@@ -699,21 +699,21 @@
 
     dtype = multiarray.dtype(dtype)
     defconv = _getconv(dtype)
-    converterseq = None    
+    converterseq = None
     if converters is None:
         converters = {}
         if dtype.names is not None:
             converterseq = [_getconv(dtype.fields[name][0]) \
                             for name in dtype.names]
-            
+
     for i,line in enumerate(fh):
         if i<skiprows: continue
         line = line[:line.find(comments)].strip()
         if not len(line): continue
         vals = line.split(delimiter)
         if converterseq is None:
-           converterseq = [converters.get(j,defconv) \
-                           for j in xrange(len(vals))]
+            converterseq = [converters.get(j,defconv) \
+                            for j in xrange(len(vals))]
         if usecols is not None:
             row = [converterseq[j](vals[j]) for j in usecols]
         else:
@@ -730,7 +730,7 @@
     else:  return X
 
 
-# adjust so that fmt can change across columns if desired. 
+# adjust so that fmt can change across columns if desired.
 
 def savetxt(fname, X, fmt='%.18e',delimiter=' '):
     """
@@ -776,11 +776,11 @@
         X.shape = origShape
 
 
-    
 
 
 
 
+
 # These are all essentially abbreviations
 # These might wind up in a special abbreviations module
 
@@ -894,10 +894,10 @@
 
     >>> seterr(over='raise') # doctest: +SKIP
     {'over': 'ignore', 'divide': 'ignore', 'invalid': 'ignore', 'under': 'ignore'}
-    
+
     >>> seterr(all='warn', over='raise') # doctest: +SKIP
     {'over': 'raise', 'divide': 'ignore', 'invalid': 'ignore', 'under': 'ignore'}
-    
+
     >>> int16(32000) * int16(3) # doctest: +SKIP
     Traceback (most recent call last):
           File "<stdin>", line 1, in ?

Modified: branches/numpy.scons/numpy/core/records.py
===================================================================
--- branches/numpy.scons/numpy/core/records.py	2007-11-13 13:10:59 UTC (rev 4450)
+++ branches/numpy.scons/numpy/core/records.py	2007-11-13 13:51:35 UTC (rev 4451)
@@ -375,7 +375,7 @@
     >>> r.col1
     array([456,   2])
     >>> r.col2
-    chararray(['dbe', 'de'], 
+    chararray(['dbe', 'de'],
           dtype='|S3')
     >>> import cPickle
     >>> print cPickle.loads(cPickle.dumps(r))

Modified: branches/numpy.scons/numpy/core/setup.py
===================================================================
--- branches/numpy.scons/numpy/core/setup.py	2007-11-13 13:10:59 UTC (rev 4450)
+++ branches/numpy.scons/numpy/core/setup.py	2007-11-13 13:51:35 UTC (rev 4451)
@@ -463,4 +463,3 @@
 if __name__=='__main__':
     from numpy.distutils.core import setup
     setup(configuration=configuration)
-

Modified: branches/numpy.scons/numpy/core/src/arraytypes.inc.src
===================================================================
--- branches/numpy.scons/numpy/core/src/arraytypes.inc.src	2007-11-13 13:10:59 UTC (rev 4450)
+++ branches/numpy.scons/numpy/core/src/arraytypes.inc.src	2007-11-13 13:51:35 UTC (rev 4451)
@@ -398,6 +398,9 @@
                 return -1;
         }
         memcpy(ov, ptr, MIN(ap->descr->elsize,len));
+	/* If string lenth is smaller than room in array
+	   Then fill the rest of the element size
+	   with NULL */
         if (ap->descr->elsize > len) {
                 memset(ov + len, 0, (ap->descr->elsize - len));
         }

Modified: branches/numpy.scons/numpy/core/src/multiarraymodule.c
===================================================================
--- branches/numpy.scons/numpy/core/src/multiarraymodule.c	2007-11-13 13:10:59 UTC (rev 4450)
+++ branches/numpy.scons/numpy/core/src/multiarraymodule.c	2007-11-13 13:51:35 UTC (rev 4451)
@@ -5710,6 +5710,9 @@
     return ret;
 }
 
+/* This function is needed for supporting Pickles of 
+   numpy scalar objects.
+*/
 static PyObject *
 array_scalar(PyObject *ignored, PyObject *args, PyObject *kwds)
 {

Modified: branches/numpy.scons/numpy/core/src/scalartypes.inc.src
===================================================================
--- branches/numpy.scons/numpy/core/src/scalartypes.inc.src	2007-11-13 13:10:59 UTC (rev 4450)
+++ branches/numpy.scons/numpy/core/src/scalartypes.inc.src	2007-11-13 13:51:35 UTC (rev 4451)
@@ -282,10 +282,9 @@
         if (outcode == NULL) return r;
 
         if (outcode->type_num == typecode->type_num) {
-                if (!PyTypeNum_ISEXTENDED(typecode->type_num))
+                if (!PyTypeNum_ISEXTENDED(typecode->type_num) || 
+	             (outcode->elsize == typecode->elsize))
                         return r;
-                if (outcode->elsize == typecode->elsize);
-                return r;
         }
 
         /* cast if necessary to desired output typecode */
@@ -1271,9 +1270,47 @@
                                  Py_BuildValue("NO", obj, mod));
         }
         else {
+#ifndef Py_UNICODE_WIDE
+	  /* We need to expand the buffer so that we always write
+	     UCS4 to disk for pickle of unicode scalars.
+
+	     This could be in a unicode_reduce function, but 
+	     that would require re-factoring.
+	  */
+		int alloc=0;
+		char *tmp;
+		int newlen;
+
+		if (PyArray_IsScalar(self, Unicode)) {
+			tmp = _pya_malloc(buflen*2);
+			if (tmp == NULL) {
+				Py_DECREF(ret);
+				return PyErr_NoMemory();
+			}
+			alloc = 1;
+			newlen = PyUCS2Buffer_AsUCS4((Py_UNICODE *)buffer,
+						     (PyArray_UCS4 *)tmp,
+						     buflen / 2, buflen / 2);
+			buflen = newlen*4;
+			buffer = tmp;
+		}
+#endif
                 mod = PyString_FromStringAndSize(buffer, buflen);
+		if (mod == NULL) {
+			Py_DECREF(ret);
+#ifndef Py_UNICODE_WIDE
+			ret = NULL;
+			goto fail;
+#else
+			return NULL;
+#endif
+		}
                 PyTuple_SET_ITEM(ret, 1,
                                  Py_BuildValue("NN", obj, mod));
+#ifndef Py_UNICODE_WIDE
+	fail:
+		if (alloc) _pya_free((char *)buffer);
+#endif
         }
         return ret;
 }

Modified: branches/numpy.scons/numpy/core/src/ucsnarrow.c
===================================================================
--- branches/numpy.scons/numpy/core/src/ucsnarrow.c	2007-11-13 13:10:59 UTC (rev 4450)
+++ branches/numpy.scons/numpy/core/src/ucsnarrow.c	2007-11-13 13:51:35 UTC (rev 4451)
@@ -39,7 +39,7 @@
    It converts up to ucs4len characters of UCS2
 
    It returns the number of characters converted which can
-   be less than ucslen if there are surrogate pairs in ucs2.
+   be less than ucs2len if there are surrogate pairs in ucs2.
 
    The return value is the actual size of the used part of the ucs4 buffer.
 */

Modified: branches/numpy.scons/numpy/core/src/ufuncobject.c
===================================================================
--- branches/numpy.scons/numpy/core/src/ufuncobject.c	2007-11-13 13:10:59 UTC (rev 4450)
+++ branches/numpy.scons/numpy/core/src/ufuncobject.c	2007-11-13 13:51:35 UTC (rev 4451)
@@ -3197,7 +3197,7 @@
 static int
 ufunc_update_use_defaults(void)
 {
-    PyObject *errobj;
+    PyObject *errobj=NULL;
     int errmask, bufsize;
     int res;
 
@@ -3206,7 +3206,7 @@
                               &errobj);
     PyUFunc_NUM_NODEFAULTS -= 1;
 
-    if (res < 0) return -1;
+    if (res < 0) {Py_XDECREF(errobj); return -1;}
 
     if ((errmask != UFUNC_ERR_DEFAULT) ||           \
         (bufsize != PyArray_BUFSIZE) ||             \
@@ -3216,6 +3216,7 @@
     else if (PyUFunc_NUM_NODEFAULTS > 0) {
         PyUFunc_NUM_NODEFAULTS -= 1;
     }
+    Py_XDECREF(errobj);
     return 0;
 }
 #endif

Modified: branches/numpy.scons/numpy/core/tests/test_defmatrix.py
===================================================================
--- branches/numpy.scons/numpy/core/tests/test_defmatrix.py	2007-11-13 13:10:59 UTC (rev 4450)
+++ branches/numpy.scons/numpy/core/tests/test_defmatrix.py	2007-11-13 13:51:35 UTC (rev 4451)
@@ -4,7 +4,7 @@
 from numpy.core import *
 restore_path()
 
-class test_ctor(NumpyTestCase):
+class TestCtor(NumpyTestCase):
     def check_basic(self):
         A = array([[1,2],[3,4]])
         mA = matrix(A)
@@ -23,7 +23,7 @@
         mvec = matrix(vec)
         assert mvec.shape == (1,5)
 
-class test_properties(NumpyTestCase):
+class TestProperties(NumpyTestCase):
     def check_sum(self):
         """Test whether matrix.sum(axis=1) preserves orientation.
         Fails in NumPy <= 0.9.6.2127.
@@ -91,7 +91,7 @@
         assert A.sum() == matrix(2)
         assert A.mean() == matrix(0.5)
 
-class test_casting(NumpyTestCase):
+class TestCasting(NumpyTestCase):
     def check_basic(self):
         A = arange(100).reshape(10,10)
         mA = matrix(A)
@@ -109,7 +109,7 @@
         assert mC.dtype.type == complex128
         assert all(mA != mB)
 
-class test_algebra(NumpyTestCase):
+class TestAlgebra(NumpyTestCase):
     def check_basic(self):
         import numpy.linalg as linalg
 
@@ -132,7 +132,7 @@
         assert allclose((mA + mA).A, (A + A))
         assert allclose((3*mA).A, (3*A))
 
-class test_matrix_return(NumpyTestCase):
+class TestMatrixReturn(NumpyTestCase):
     def check_instance_methods(self):
         a = matrix([1.0], dtype='f8')
         methodargs = {
@@ -171,7 +171,7 @@
         assert type(c) is matrix
         assert type(d) is matrix
 
-class test_indexing(NumpyTestCase):
+class TestIndexing(NumpyTestCase):
     def check_basic(self):
         x = asmatrix(zeros((3,2),float))
         y = zeros((3,1),float)

Modified: branches/numpy.scons/numpy/core/tests/test_errstate.py
===================================================================
--- branches/numpy.scons/numpy/core/tests/test_errstate.py	2007-11-13 13:10:59 UTC (rev 4450)
+++ branches/numpy.scons/numpy/core/tests/test_errstate.py	2007-11-13 13:51:35 UTC (rev 4451)
@@ -14,7 +14,7 @@
 
 
 
-class test_errstate(NumpyTestCase):
+class TestErrstate(NumpyTestCase):
 
 
     def test_invalid(self):

Modified: branches/numpy.scons/numpy/core/tests/test_ma.py
===================================================================
--- branches/numpy.scons/numpy/core/tests/test_ma.py	2007-11-13 13:10:59 UTC (rev 4450)
+++ branches/numpy.scons/numpy/core/tests/test_ma.py	2007-11-13 13:51:35 UTC (rev 4451)
@@ -13,7 +13,7 @@
 %s"""% (msg, str(v), str(w))
     return result
 
-class test_ma(NumpyTestCase):
+class TestMa(NumpyTestCase):
     def __init__(self, *args, **kwds):
         NumpyTestCase.__init__(self, *args, **kwds)
         self.setUp()
@@ -647,7 +647,7 @@
         self.failUnlessEqual(b[0].shape, ())
         self.failUnlessEqual(b[1].shape, ())
 
-class test_ufuncs(NumpyTestCase):
+class TestUfuncs(NumpyTestCase):
     def setUp(self):
         self.d = (array([1.0, 0, -1, pi/2]*2, mask=[0,1]+[0]*6),
                   array([1.0, 0, -1, pi/2]*2, mask=[1,0]+[0]*6),)
@@ -714,7 +714,7 @@
             self.failUnless(eq(nonzero(x), [0]))
 
 
-class test_array_methods(NumpyTestCase):
+class TestArrayMethods(NumpyTestCase):
 
     def setUp(self):
         x = numpy.array([ 8.375,  7.545,  8.828,  8.5  ,  1.757,  5.928,

Modified: branches/numpy.scons/numpy/core/tests/test_multiarray.py
===================================================================
--- branches/numpy.scons/numpy/core/tests/test_multiarray.py	2007-11-13 13:10:59 UTC (rev 4450)
+++ branches/numpy.scons/numpy/core/tests/test_multiarray.py	2007-11-13 13:51:35 UTC (rev 4451)
@@ -3,7 +3,7 @@
 from numpy import random
 import numpy as N
 
-class test_flags(NumpyTestCase):
+class TestFlags(NumpyTestCase):
     def setUp(self):
         self.a = arange(10)
 
@@ -27,7 +27,7 @@
         assert_equal(self.a.flags.updateifcopy, False)
 
 
-class test_attributes(NumpyTestCase):
+class TestAttributes(NumpyTestCase):
     def setUp(self):
         self.one = arange(10)
         self.two = arange(20).reshape(4,5)
@@ -104,14 +104,14 @@
         x.fill(x[0])
         assert_equal(x['f1'][1], x['f1'][0])
 
-class test_dtypedescr(NumpyTestCase):
+class TestDtypedescr(NumpyTestCase):
     def check_construction(self):
         d1 = dtype('i4')
         assert_equal(d1, dtype(int32))
         d2 = dtype('f8')
         assert_equal(d2, dtype(float64))
 
-class test_fromstring(NumpyTestCase):
+class TestFromstring(NumpyTestCase):
     def check_binary(self):
         a = fromstring('\x00\x00\x80?\x00\x00\x00@\x00\x00@@\x00\x00\x80@',dtype='<f4')
         assert_array_equal(a, array([1,2,3,4]))
@@ -140,7 +140,7 @@
         assert_array_equal(a, [1.,2.,3.,4.])
         assert_array_equal(a,b)
 
-class test_zero_rank(NumpyTestCase):
+class TestZeroRank(NumpyTestCase):
     def setUp(self):
         self.d = array(0), array('x', object)
 
@@ -216,14 +216,14 @@
         x = array(2)
         self.failUnlessRaises(ValueError, add, x, [1], x)
 
-class test_creation(NumpyTestCase):
+class TestCreation(NumpyTestCase):
     def check_from_attribute(self):
         class x(object):
             def __array__(self, dtype=None):
                 pass
         self.failUnlessRaises(ValueError, array, x())
 
-class test_bool(NumpyTestCase):
+class TestBool(NumpyTestCase):
     def check_test_interning(self):
         a0 = bool_(0)
         b0 = bool_(False)
@@ -235,7 +235,7 @@
         self.failUnless(array(True)[()] is a1)
 
 
-class test_methods(NumpyTestCase):
+class TestMethods(NumpyTestCase):
     def check_test_round(self):
         assert_equal(array([1.2,1.5]).round(), [1,2])
         assert_equal(array(1.5).round(), 2)
@@ -249,13 +249,13 @@
         self.failUnlessRaises(ValueError, lambda: a.transpose(0,0))
         self.failUnlessRaises(ValueError, lambda: a.transpose(0,1,2))
 
-class test_subscripting(NumpyTestCase):
+class TestSubscripting(NumpyTestCase):
     def check_test_zero_rank(self):
         x = array([1,2,3])
         self.failUnless(isinstance(x[0], int))
         self.failUnless(type(x[0, ...]) is ndarray)
 
-class test_pickling(NumpyTestCase):
+class TestPickling(NumpyTestCase):
     def check_both(self):
         import pickle
         carray = array([[2,9],[7,0],[3,8]])
@@ -302,7 +302,7 @@
         p = loads(s)
         assert_equal(a, p)
 
-class test_fancy_indexing(NumpyTestCase):
+class TestFancyIndexing(NumpyTestCase):
     def check_list(self):
         x = ones((1,1))
         x[:,[0]] = 2.0
@@ -320,7 +320,7 @@
         x[:,:,(0,)] = 2.0
         assert_array_equal(x, array([[[2.0]]]))
 
-class test_string_compare(NumpyTestCase):
+class TestStringCompare(NumpyTestCase):
     def check_string(self):
         g1 = array(["This","is","example"])
         g2 = array(["This","was","example"])
@@ -353,7 +353,7 @@
         assert_array_equal(g1 > g2,  [g1[i] > g2[i] for i in [0,1,2]])
 
 
-class test_argmax(NumpyTestCase):
+class TestArgmax(NumpyTestCase):
     def check_all(self):
         a = random.normal(0,1,(4,5,6,7,8))
         for i in xrange(a.ndim):
@@ -363,13 +363,13 @@
             axes.remove(i)
             assert all(amax == aargmax.choose(*a.transpose(i,*axes)))
 
-class test_newaxis(NumpyTestCase):
+class TestNewaxis(NumpyTestCase):
     def check_basic(self):
         sk = array([0,-0.1,0.1])
         res = 250*sk[:,newaxis]
         assert_almost_equal(res.ravel(),250*sk)
 
-class test_clip(NumpyTestCase):
+class TestClip(NumpyTestCase):
     def _check_range(self,x,cmin,cmax):
         assert N.all(x >= cmin)
         assert N.all(x <= cmax)

Modified: branches/numpy.scons/numpy/core/tests/test_numeric.py
===================================================================
--- branches/numpy.scons/numpy/core/tests/test_numeric.py	2007-11-13 13:10:59 UTC (rev 4450)
+++ branches/numpy.scons/numpy/core/tests/test_numeric.py	2007-11-13 13:51:35 UTC (rev 4451)
@@ -31,7 +31,7 @@
         return "Vec("+repr(self.array.tolist())+")"
     __str__=__repr__
 
-class test_dot(NumpyTestCase):
+class TestDot(NumpyTestCase):
     def setUp(self):
         self.A = rand(10,8)
         self.b1 = rand(8,1)
@@ -141,7 +141,7 @@
         assert_equal(zeros[1].array, zeros_test[1].array)
 
 
-class test_bool_scalar(NumpyTestCase):
+class TestBoolScalar(NumpyTestCase):
     def test_logical(self):
         f = False_
         t = True_
@@ -174,7 +174,7 @@
         self.failUnless((f ^ f) is f)
 
 
-class test_seterr(NumpyTestCase):
+class TestSeterr(NumpyTestCase):
     def test_set(self):
         err = seterr()
         old = seterr(divide='warn')
@@ -198,7 +198,7 @@
         array([1.]) / array([0.])
 
 
-class test_fromiter(NumpyTestCase):
+class TestFromiter(NumpyTestCase):
 
     def makegen(self):
         for x in xrange(24):
@@ -232,7 +232,7 @@
         self.failUnless(alltrue(a == expected,axis=0))
         self.failUnless(alltrue(a20 == expected[:20],axis=0))
 
-class test_index(NumpyTestCase):
+class TestIndex(NumpyTestCase):
     def test_boolean(self):
         a = rand(3,5,8)
         V = rand(5,8)
@@ -241,7 +241,7 @@
         V[g1,g2] = -V[g1,g2]
         assert (array([a[0][V>0],a[1][V>0],a[2][V>0]]) == a[:,V>0]).all()
 
-class test_binary_repr(NumpyTestCase):
+class TestBinaryRepr(NumpyTestCase):
     def test_zero(self):
         assert_equal(binary_repr(0),'0')
 
@@ -260,7 +260,7 @@
     assert x.dtype.isnative == y.dtype.isnative
 
 
-class test_clip(NumpyTestCase):
+class TestClip(NumpyTestCase):
     def setUp(self):
         self.nr = 5
         self.nc = 3
@@ -275,13 +275,13 @@
         # use slow-clip
         selector = less(a, m)+2*greater(a, M)
         return selector.choose((a, m, M), out=out)
-    
+
     # Handy functions
     def _generate_data(self, n, m):
         return randn(n, m)
 
     def _generate_data_complex(self, n, m):
-        return randn(n, m) + 1.j *rand(n, m) 
+        return randn(n, m) + 1.j *rand(n, m)
 
     def _generate_flt_data(self, n, m):
         return (randn(n, m)).astype(float32)
@@ -320,7 +320,7 @@
     def test_simple_int(self):
         """Test native int input with scalar min/max."""
         a   = self._generate_int_data(self.nr, self.nc)
-        a   = a.astype(int) 
+        a   = a.astype(int)
         m   = -2
         M   = 4
         ac  = self.fastclip(a, m, M)
@@ -484,7 +484,7 @@
     def test_type_cast_02(self):
         "Test native int32 input with int32 scalar min/max."
         a   = self._generate_int_data(self.nr, self.nc)
-        a   = a.astype(int32) 
+        a   = a.astype(int32)
         m   = -2
         M   = 4
         ac  = self.fastclip(a, m, M)
@@ -507,7 +507,7 @@
         M   = float32(4)
         act = self.fastclip(a,m,M)
         ac  = self.clip(a,m,M)
-        assert_array_strict_equal(ac, act)        
+        assert_array_strict_equal(ac, act)
 
     def test_type_cast_04(self):
         "Test native int32 with double arrays min/max."

Modified: branches/numpy.scons/numpy/core/tests/test_numerictypes.py
===================================================================
--- branches/numpy.scons/numpy/core/tests/test_numerictypes.py	2007-11-13 13:10:59 UTC (rev 4450)
+++ branches/numpy.scons/numpy/core/tests/test_numerictypes.py	2007-11-13 13:51:35 UTC (rev 4451)
@@ -331,7 +331,7 @@
     multiple_rows = True
     _buffer = NbufferT
 
-class test_empty_field(NumpyTestCase):
+class TestEmptyField(NumpyTestCase):
     def check_assign(self):
         a = numpy.arange(10, dtype=numpy.float32)
         a.dtype = [("int",   "<0i4"),("float", "<2f4")]

Modified: branches/numpy.scons/numpy/core/tests/test_records.py
===================================================================
--- branches/numpy.scons/numpy/core/tests/test_records.py	2007-11-13 13:10:59 UTC (rev 4450)
+++ branches/numpy.scons/numpy/core/tests/test_records.py	2007-11-13 13:51:35 UTC (rev 4451)
@@ -6,7 +6,7 @@
 from numpy.core import *
 restore_path()
 
-class test_fromrecords(NumpyTestCase):
+class TestFromrecords(NumpyTestCase):
     def check_fromrecords(self):
         r = rec.fromrecords([[456,'dbe',1.2],[2,'de',1.3]],names='col1,col2,col3')
         assert_equal(r[0].item(),(456, 'dbe', 1.2))
@@ -85,7 +85,7 @@
         assert_array_equal(ra['field'], [[5,5,5]])
         assert callable(ra.field)
 
-class test_record(NumpyTestCase):
+class TestRecord(NumpyTestCase):
     def setUp(self):
         self.data = rec.fromrecords([(1,2,3),(4,5,6)],
                             dtype=[("col1", "<i4"),

Modified: branches/numpy.scons/numpy/core/tests/test_scalarmath.py
===================================================================
--- branches/numpy.scons/numpy/core/tests/test_scalarmath.py	2007-11-13 13:10:59 UTC (rev 4450)
+++ branches/numpy.scons/numpy/core/tests/test_scalarmath.py	2007-11-13 13:51:35 UTC (rev 4451)
@@ -12,7 +12,7 @@
 
 # This compares scalarmath against ufuncs.
 
-class test_types(NumpyTestCase):
+class TestTypes(NumpyTestCase):
     def check_types(self, level=1):
         for atype in types:
             a = atype(1)
@@ -38,7 +38,7 @@
             b = atype([1,2,3])
             assert_equal(a,b)
 
-class test_power(NumpyTestCase):
+class TestPower(NumpyTestCase):
     def check_small_types(self):
         for t in [N.int8, N.int16]:
             a = t(3)
@@ -51,7 +51,7 @@
             b = a ** 4
             assert b == 6765201, "error with %r: got %r" % (t,b)
 
-class test_conversion(NumpyTestCase):
+class TestConversion(NumpyTestCase):
     def test_int_from_long(self):
         l = [1e6, 1e12, 1e18, -1e6, -1e12, -1e18]
         li = [10**6, 10**12, 10**18, -10**6, -10**12, -10**18]

Modified: branches/numpy.scons/numpy/core/tests/test_umath.py
===================================================================
--- branches/numpy.scons/numpy/core/tests/test_umath.py	2007-11-13 13:10:59 UTC (rev 4450)
+++ branches/numpy.scons/numpy/core/tests/test_umath.py	2007-11-13 13:51:35 UTC (rev 4451)
@@ -5,7 +5,7 @@
 from numpy import zeros, ndarray, array, choose
 restore_path()
 
-class test_division(NumpyTestCase):
+class TestDivision(NumpyTestCase):
     def check_division_int(self):
         # int division should return the floor of the result, a la Python
         x = array([5, 10, 90, 100, -5, -10, -90, -100, -120])
@@ -13,7 +13,7 @@
         assert_equal(x // 100, [0, 0, 0, 1, -1, -1, -1, -1, -2])
         assert_equal(x % 100, [5, 10, 90, 0, 95, 90, 10, 0, 80])
 
-class test_power(NumpyTestCase):
+class TestPower(NumpyTestCase):
     def check_power_float(self):
         x = array([1., 2., 3.])
         assert_equal(x**0, [1., 1., 1.])
@@ -38,30 +38,30 @@
         assert_almost_equal(x**14, [-76443+16124j, 23161315+58317492j,
                                     5583548873 +  2465133864j])
 
-class test_log1p(NumpyTestCase):
+class TestLog1p(NumpyTestCase):
     def check_log1p(self):
         assert_almost_equal(ncu.log1p(0.2), ncu.log(1.2))
         assert_almost_equal(ncu.log1p(1e-6), ncu.log(1+1e-6))
 
-class test_expm1(NumpyTestCase):
+class TestExpm1(NumpyTestCase):
     def check_expm1(self):
         assert_almost_equal(ncu.expm1(0.2), ncu.exp(0.2)-1)
         assert_almost_equal(ncu.expm1(1e-6), ncu.exp(1e-6)-1)
 
-class test_maximum(NumpyTestCase):
+class TestMaximum(NumpyTestCase):
     def check_reduce_complex(self):
         assert_equal(maximum.reduce([1,2j]),1)
         assert_equal(maximum.reduce([1+3j,2j]),1+3j)
 
-class test_minimum(NumpyTestCase):
+class TestMinimum(NumpyTestCase):
     def check_reduce_complex(self):
         assert_equal(minimum.reduce([1,2j]),2j)
 
-class test_floating_point(NumpyTestCase):
+class TestFloatingPoint(NumpyTestCase):
     def check_floating_point(self):
         assert_equal(ncu.FLOATING_POINT_SUPPORT, 1)
 
-class test_special_methods(NumpyTestCase):
+class TestSpecialMethods(NumpyTestCase):
     def test_wrap(self):
         class with_wrap(object):
             def __array__(self):
@@ -163,7 +163,7 @@
         assert_equal(maximum(a, B()), 0)
         assert_equal(maximum(a, C()), 0)
 
-class test_choose(NumpyTestCase):
+class TestChoose(NumpyTestCase):
     def test_mixed(self):
         c = array([True,True])
         a = array([True,True])
@@ -183,7 +183,7 @@
             assert_almost_equal(fun(self.x),cr.real)
             assert_almost_equal(0, cr.imag)
 
-class test_choose(NumpyTestCase):
+class TestChoose(NumpyTestCase):
     def test_attributes(self):
         add = ncu.add
         assert_equal(add.__name__, 'add')

Modified: branches/numpy.scons/numpy/distutils/__init__.py
===================================================================
--- branches/numpy.scons/numpy/distutils/__init__.py	2007-11-13 13:10:59 UTC (rev 4450)
+++ branches/numpy.scons/numpy/distutils/__init__.py	2007-11-13 13:51:35 UTC (rev 4451)
@@ -1,22 +1,6 @@
 
 from __version__ import version as __version__
 
-# Check that distutils has not been imported before.
-import sys
-if 'distutils' in sys.modules:
-    sys.stderr.write('''\
-********************************************************
-WARNING!WARNING!WARNING!WARNING!WARNING!WARNING!WARNING!
-
-distutils has been imported before numpy.distutils
-and now numpy.distutils cannot apply all of its
-customizations to distutils effectively.
-
-To avoid this warning, make sure that numpy.distutils
-is imported *before* distutils.
-********************************************************
-''')
-
 # Must import local ccompiler ASAP in order to get
 # customized CCompiler.spawn effective.
 import ccompiler

Modified: branches/numpy.scons/numpy/distutils/ccompiler.py
===================================================================
--- branches/numpy.scons/numpy/distutils/ccompiler.py	2007-11-13 13:10:59 UTC (rev 4450)
+++ branches/numpy.scons/numpy/distutils/ccompiler.py	2007-11-13 13:51:35 UTC (rev 4451)
@@ -207,7 +207,7 @@
         except (AttributeError, ValueError):
             pass
 
-        if hasattr(self,'compiler') and self.compiler[0].find('cc')>=0:
+        if hasattr(self,'compiler') and 'cc' in self.compiler[0]:
             if not self.compiler_cxx:
                 if self.compiler[0].startswith('gcc'):
                     a, b = 'gcc', 'g++'
@@ -217,7 +217,7 @@
                                     + self.compiler[1:]
         else:
             if hasattr(self,'compiler'):
-                 log.warn("#### %s #######" % (self.compiler,))
+                log.warn("#### %s #######" % (self.compiler,))
             log.warn('Missing compiler_cxx fix for '+self.__class__.__name__)
     return
 
@@ -384,6 +384,15 @@
     return lib_opts
 ccompiler.gen_lib_options = gen_lib_options
 
+# Also fix up the various compiler modules, which do
+# from distutils.ccompiler import gen_lib_options
+# Don't bother with mwerks, as we don't support Classic Mac.
+for _cc in ['msvc', 'bcpp', 'cygwinc', 'emxc', 'unixc']:
+    _m = sys.modules.get('distutils.'+_cc+'compiler')
+    if _m is not None:
+        setattr(getattr(_m, _cc+'compiler'), 'gen_lib_options',
+                gen_lib_options)
+
 _distutils_gen_preprocess_options = gen_preprocess_options
 def gen_preprocess_options (macros, include_dirs):
     include_dirs = quote_args(include_dirs)
@@ -391,7 +400,8 @@
 ccompiler.gen_preprocess_options = gen_preprocess_options
 
 ##Fix distutils.util.split_quoted:
-import re,string
+import re
+import string
 _wordchars_re = re.compile(r'[^\\\'\"%s ]*' % string.whitespace)
 _squote_re = re.compile(r"'(?:[^'\\]|\\.)*'")
 _dquote_re = re.compile(r'"(?:[^"\\]|\\.)*"')

Modified: branches/numpy.scons/numpy/distutils/command/build_ext.py
===================================================================
--- branches/numpy.scons/numpy/distutils/command/build_ext.py	2007-11-13 13:10:59 UTC (rev 4450)
+++ branches/numpy.scons/numpy/distutils/command/build_ext.py	2007-11-13 13:51:35 UTC (rev 4451)
@@ -105,13 +105,14 @@
             c_lib_dirs = []
             macros = []
             for libname in ext.libraries:
-                if clibs.has_key(libname):
+                if libname in clibs:
                     binfo = clibs[libname]
                     c_libs += binfo.get('libraries',[])
                     c_lib_dirs += binfo.get('library_dirs',[])
                     for m in binfo.get('macros',[]):
                         if m not in macros:
                             macros.append(m)
+
                 for l in clibs.get(libname,{}).get('source_languages',[]):
                     ext_languages.add(l)
             if c_libs:

Modified: branches/numpy.scons/numpy/distutils/command/build_src.py
===================================================================
--- branches/numpy.scons/numpy/distutils/command/build_src.py	2007-11-13 13:10:59 UTC (rev 4450)
+++ branches/numpy.scons/numpy/distutils/command/build_src.py	2007-11-13 13:51:35 UTC (rev 4451)
@@ -1,4 +1,4 @@
-""" Build swig, f2py, weave, sources.
+""" Build swig, f2py, pyrex sources.
 """
 
 import os
@@ -116,7 +116,7 @@
             self.swig_cpp = build_ext.swig_cpp
         for c in ['swig','swig_opt']:
             o = '--'+c.replace('_','-')
-            v = getattr(build_ext,c,None) 
+            v = getattr(build_ext,c,None)
             if v:
                 if getattr(self,c):
                     log.warn('both build_src and build_ext define %s option' % (o))
@@ -376,35 +376,43 @@
         for source in sources:
             (base, ext) = os.path.splitext(source)
             if ext == '.pyx':
-                if self.inplace or not have_pyrex:
-                    target_dir = os.path.dirname(base)
-                else:
-                    target_dir = appendpath(self.build_src, os.path.dirname(base))
-                target_file = os.path.join(target_dir, ext_name + '.c')
-                depends = [source] + extension.depends
-                if (self.force or newer_group(depends, target_file, 'newer')):
-                    if have_pyrex:
-                        log.info("pyrexc:> %s" % (target_file))
-                        self.mkpath(target_dir)
-                        options = Pyrex.Compiler.Main.CompilationOptions(
-                            defaults=Pyrex.Compiler.Main.default_options,
-                            output_file=target_file)
-                        pyrex_result = Pyrex.Compiler.Main.compile(source,
-                                            options=options)
-                        if pyrex_result.num_errors != 0:
-                            raise DistutilsError,"%d errors while compiling %r with Pyrex" \
-                                  % (pyrex_result.num_errors, source)
-                    elif os.path.isfile(target_file):
-                        log.warn("Pyrex required for compiling %r but not available,"\
-                                 " using old target %r"\
-                                 % (source, target_file))
-                    else:
-                        raise DistutilsError,"Pyrex required for compiling %r but not available" % (source)
+                target_file = self.generate_a_pyrex_source(base, ext_name,
+                                                           source,
+                                                           extension)
                 new_sources.append(target_file)
             else:
                 new_sources.append(source)
         return new_sources
 
+    def generate_a_pyrex_source(self, base, ext_name, source, extension):
+        if self.inplace or not have_pyrex:
+            target_dir = os.path.dirname(base)
+        else:
+            target_dir = appendpath(self.build_src, os.path.dirname(base))
+        target_file = os.path.join(target_dir, ext_name + '.c')
+        depends = [source] + extension.depends
+        if self.force or newer_group(depends, target_file, 'newer'):
+            if have_pyrex:
+                log.info("pyrexc:> %s" % (target_file))
+                self.mkpath(target_dir)
+                options = Pyrex.Compiler.Main.CompilationOptions(
+                    defaults=Pyrex.Compiler.Main.default_options,
+                    include_path=extension.include_dirs,
+                    output_file=target_file)
+                pyrex_result = Pyrex.Compiler.Main.compile(source,
+                                                           options=options)
+                if pyrex_result.num_errors != 0:
+                    raise DistutilsError,"%d errors while compiling %r with Pyrex" \
+                          % (pyrex_result.num_errors, source)
+            elif os.path.isfile(target_file):
+                log.warn("Pyrex required for compiling %r but not available,"\
+                         " using old target %r"\
+                         % (source, target_file))
+            else:
+                raise DistutilsError("Pyrex required for compiling %r"\
+                                     " but notavailable" % (source,))
+        return target_file
+
     def f2py_sources(self, sources, extension):
         new_sources = []
         f2py_sources = []

Modified: branches/numpy.scons/numpy/distutils/command/config.py
===================================================================
--- branches/numpy.scons/numpy/distutils/command/config.py	2007-11-13 13:10:59 UTC (rev 4450)
+++ branches/numpy.scons/numpy/distutils/command/config.py	2007-11-13 13:51:35 UTC (rev 4451)
@@ -156,4 +156,3 @@
 
         self._clean()
         return exitcode, output
-

Modified: branches/numpy.scons/numpy/distutils/core.py
===================================================================
--- branches/numpy.scons/numpy/distutils/core.py	2007-11-13 13:10:59 UTC (rev 4450)
+++ branches/numpy.scons/numpy/distutils/core.py	2007-11-13 13:51:35 UTC (rev 4451)
@@ -94,30 +94,30 @@
     # We can't use isinstance, as the DistributionWithoutHelpCommands
     # class is local to a function in setuptools.command.easy_install
     if dist is not None and \
-            repr(dist).find('DistributionWithoutHelpCommands') != -1:
+            'DistributionWithoutHelpCommands' in repr(dist):
         raise NotImplementedError("setuptools not supported yet for numpy.scons branch")
         dist = None
     if always and dist is None:
         dist = NumpyDistribution()
     return dist
 
-def _exit_interactive_session(_cache=[]): 
-    if _cache: 
-        return # been here 
-    _cache.append(1) 
-    print '-'*72 
-    raw_input('Press ENTER to close the interactive session..') 
-    print '='*72 
+def _exit_interactive_session(_cache=[]):
+    if _cache:
+        return # been here
+    _cache.append(1)
+    print '-'*72
+    raw_input('Press ENTER to close the interactive session..')
+    print '='*72
 
 def setup(**attr):
 
-    if len(sys.argv)<=1 and not attr.get('script_args',[]): 
-        from interactive import interactive_sys_argv 
-        import atexit 
-        atexit.register(_exit_interactive_session) 
-        sys.argv[:] = interactive_sys_argv(sys.argv) 
-        if len(sys.argv)>1: 
-            return setup(**attr) 
+    if len(sys.argv)<=1 and not attr.get('script_args',[]):
+        from interactive import interactive_sys_argv
+        import atexit
+        atexit.register(_exit_interactive_session)
+        sys.argv[:] = interactive_sys_argv(sys.argv)
+        if len(sys.argv)>1:
+            return setup(**attr)
 
     cmdclass = numpy_cmdclass.copy()
 

Modified: branches/numpy.scons/numpy/distutils/cpuinfo.py
===================================================================
--- branches/numpy.scons/numpy/distutils/cpuinfo.py	2007-11-13 13:10:59 UTC (rev 4450)
+++ branches/numpy.scons/numpy/distutils/cpuinfo.py	2007-11-13 13:51:35 UTC (rev 4451)
@@ -8,22 +8,55 @@
 terms of the NumPy (BSD style) license.  See LICENSE.txt that came with
 this distribution for specifics.
 
-Note:  This should be merged into proc at some point.  Perhaps proc should
-be returning classes like this instead of using dictionaries.
-
 NO WARRANTY IS EXPRESSED OR IMPLIED.  USE AT YOUR OWN RISK.
-$Revision: 1.1 $
-$Date: 2005/04/09 19:29:34 $
 Pearu Peterson
 """
 
-__version__ = "$Id: cpuinfo.py,v 1.1 2005/04/09 19:29:34 pearu Exp $"
-
 __all__ = ['cpu']
 
-import sys,string,re,types
+import sys, re, types
+import os
+import commands
+import warnings
 
-class cpuinfo_base:
+def getoutput(cmd, successful_status=(0,), stacklevel=1):
+    try:
+        status, output = commands.getstatusoutput(cmd)
+    except EnvironmentError, e:
+        warnings.warn(str(e), UserWarning, stacklevel=stacklevel)
+        return False, output
+    if os.WIFEXITED(status) and os.WEXITSTATUS(status) in successful_status:
+        return True, output
+    return False, output
+
+def command_info(successful_status=(0,), stacklevel=1, **kw):
+    info = {}
+    for key in kw:
+        ok, output = getoutput(kw[key], successful_status=successful_status,
+                               stacklevel=stacklevel+1)
+        if ok:
+            info[key] = output.strip()
+    return info
+
+def command_by_line(cmd, successful_status=(0,), stacklevel=1):
+    ok, output = getoutput(cmd, successful_status=successful_status,
+                           stacklevel=stacklevel+1)
+    if not ok:
+        return
+    for line in output.splitlines():
+        yield line.strip()
+
+def key_value_from_command(cmd, sep, successful_status=(0,),
+                           stacklevel=1):
+    d = {}
+    for line in command_by_line(cmd, successful_status=successful_status,
+                                stacklevel=stacklevel+1):
+        l = [s.strip() for s in line.split(sep, 1)]
+        if len(l) == 2:
+            d[l[0]] = l[1]
+    return d
+
+class CPUInfoBase(object):
     """Holds CPU information and provides methods for requiring
     the availability of various CPU features.
     """
@@ -35,7 +68,7 @@
             pass
 
     def __getattr__(self,name):
-        if name[0]!='_':
+        if not name.startswith('_'):
             if hasattr(self,'_'+name):
                 attr = getattr(self,'_'+name)
                 if type(attr) is types.MethodType:
@@ -50,30 +83,31 @@
     def _is_32bit(self):
         return not self.is_64bit()
 
-class linux_cpuinfo(cpuinfo_base):
+class LinuxCPUInfo(CPUInfoBase):
 
     info = None
 
     def __init__(self):
         if self.info is not None:
             return
-        info = []
+        info = [ {} ]
+        ok, output = getoutput('uname -m')
+        if ok:
+            info[0]['uname_m'] = output.strip()
         try:
-            for line in open('/proc/cpuinfo').readlines():
-                name_value = map(string.strip,string.split(line,':',1))
-                if len(name_value)!=2:
+            fo = open('/proc/cpuinfo')
+        except EnvironmentError, e:
+            warnings.warn(str(e), UserWarning)
+        else:
+            for line in fo:
+                name_value = [s.strip() for s in line.split(':', 1)]
+                if len(name_value) != 2:
                     continue
-                name,value = name_value
+                name, value = name_value
                 if not info or info[-1].has_key(name): # next processor
                     info.append({})
                 info[-1][name] = value
-            import commands
-            status,output = commands.getstatusoutput('uname -m')
-            if not status:
-                if not info: info.append({})
-                info[-1]['uname_m'] = string.strip(output)
-        except:
-            print sys.exc_value,'(ignoring)'
+            fo.close()
         self.__class__.info = info
 
     def _not_impl(self): pass
@@ -99,6 +133,9 @@
         return re.match(r'.*?Athlon\(tm\) MP\b',
                         self.info[0]['model name']) is not None
 
+    def _is_AMD64(self):
+        return self.is_AMD() and self.info[0]['family'] == '15'
+
     def _is_Athlon64(self):
         return re.match(r'.*?Athlon\(tm\) 64\b',
                         self.info[0]['model name']) is not None
@@ -248,42 +285,26 @@
     def _is_32bit(self):
         return not self.is_64bit()
 
-class irix_cpuinfo(cpuinfo_base):
-
+class IRIXCPUInfo(CPUInfoBase):
     info = None
 
     def __init__(self):
         if self.info is not None:
             return
-        info = []
-        try:
-            import commands
-            status,output = commands.getstatusoutput('sysconf')
-            if status not in [0,256]:
-                return
-            for line in output.split('\n'):
-                name_value = map(string.strip,string.split(line,' ',1))
-                if len(name_value)!=2:
-                    continue
-                name,value = name_value
-                if not info:
-                    info.append({})
-                info[-1][name] = value
-        except:
-            print sys.exc_value,'(ignoring)'
+        info = key_value_from_command('sysconf', sep=' ',
+                                      successful_status=(0,1))
         self.__class__.info = info
 
-        #print info
     def _not_impl(self): pass
 
     def _is_singleCPU(self):
-        return self.info[0].get('NUM_PROCESSORS') == '1'
+        return self.info.get('NUM_PROCESSORS') == '1'
 
     def _getNCPUs(self):
-        return int(self.info[0].get('NUM_PROCESSORS'))
+        return int(self.info.get('NUM_PROCESSORS', 1))
 
     def __cputype(self,n):
-        return self.info[0].get('PROCESSORS').split()[0].lower() == 'r%s' % (n)
+        return self.info.get('PROCESSORS').split()[0].lower() == 'r%s' % (n)
     def _is_r2000(self): return self.__cputype(2000)
     def _is_r3000(self): return self.__cputype(3000)
     def _is_r3900(self): return self.__cputype(3900)
@@ -301,10 +322,10 @@
     def _is_rorion(self): return self.__cputype('orion')
 
     def get_ip(self):
-        try: return self.info[0].get('MACHINE')
+        try: return self.info.get('MACHINE')
         except: pass
     def __machine(self,n):
-        return self.info[0].get('MACHINE').lower() == 'ip%s' % (n)
+        return self.info.get('MACHINE').lower() == 'ip%s' % (n)
     def _is_IP19(self): return self.__machine(19)
     def _is_IP20(self): return self.__machine(20)
     def _is_IP21(self): return self.__machine(21)
@@ -321,53 +342,33 @@
     def _is_IP32_5k(self): return self.__machine(32) and self._is_r5000()
     def _is_IP32_10k(self): return self.__machine(32) and self._is_r10000()
 
-class darwin_cpuinfo(cpuinfo_base):
 
+class DarwinCPUInfo(CPUInfoBase):
     info = None
 
     def __init__(self):
         if self.info is not None:
             return
-        info = []
-        try:
-            import commands
-            status,output = commands.getstatusoutput('arch')
-            if not status:
-                if not info: info.append({})
-                info[-1]['arch'] = string.strip(output)
-            status,output = commands.getstatusoutput('machine')
-            if not status:
-                if not info: info.append({})
-                info[-1]['machine'] = string.strip(output)
-            status,output = commands.getstatusoutput('sysctl hw')
-            if not status:
-                if not info: info.append({})
-                d = {}
-                for l in string.split(output,'\n'):
-                    l = map(string.strip,string.split(l, '='))
-                    if len(l)==2:
-                        d[l[0]]=l[1]
-                info[-1]['sysctl_hw'] = d
-        except:
-            print sys.exc_value,'(ignoring)'
+        info = command_info(arch='arch',
+                            machine='machine')
+        info['sysctl_hw'] = key_value_from_command('sysctl hw', sep='=')
         self.__class__.info = info
 
     def _not_impl(self): pass
 
     def _getNCPUs(self):
-        try: return int(self.info[0]['sysctl_hw']['hw.ncpu'])
-        except: return 1
+        return int(self.info['sysctl_hw'].get('hw.ncpu', 1))
 
     def _is_Power_Macintosh(self):
-        return self.info[0]['sysctl_hw']['hw.machine']=='Power Macintosh'
+        return self.info['sysctl_hw']['hw.machine']=='Power Macintosh'
 
     def _is_i386(self):
-        return self.info[0]['arch']=='i386'
+        return self.info['arch']=='i386'
     def _is_ppc(self):
-        return self.info[0]['arch']=='ppc'
+        return self.info['arch']=='ppc'
 
     def __machine(self,n):
-        return self.info[0]['machine'] == 'ppc%s'%n
+        return self.info['machine'] == 'ppc%s'%n
     def _is_ppc601(self): return self.__machine(601)
     def _is_ppc602(self): return self.__machine(602)
     def _is_ppc603(self): return self.__machine(603)
@@ -387,120 +388,90 @@
     def _is_ppc823(self): return self.__machine(823)
     def _is_ppc860(self): return self.__machine(860)
 
-class sunos_cpuinfo(cpuinfo_base):
 
+class SunOSCPUInfo(CPUInfoBase):
+
     info = None
 
     def __init__(self):
         if self.info is not None:
             return
-        info = []
-        try:
-            import commands
-            status,output = commands.getstatusoutput('arch')
-            if not status:
-                if not info: info.append({})
-                info[-1]['arch'] = string.strip(output)
-            status,output = commands.getstatusoutput('mach')
-            if not status:
-                if not info: info.append({})
-                info[-1]['mach'] = string.strip(output)
-            status,output = commands.getstatusoutput('uname -i')
-            if not status:
-                if not info: info.append({})
-                info[-1]['uname_i'] = string.strip(output)
-            status,output = commands.getstatusoutput('uname -X')
-            if not status:
-                if not info: info.append({})
-                d = {}
-                for l in string.split(output,'\n'):
-                    l = map(string.strip,string.split(l, '='))
-                    if len(l)==2:
-                        d[l[0]]=l[1]
-                info[-1]['uname_X'] = d
-            status,output = commands.getstatusoutput('isainfo -b')
-            if not status:
-                if not info: info.append({})
-                info[-1]['isainfo_b'] = string.strip(output)
-            status,output = commands.getstatusoutput('isainfo -n')
-            if not status:
-                if not info: info.append({})
-                info[-1]['isainfo_n'] = string.strip(output)
-            status,output = commands.getstatusoutput('psrinfo -v 0')
-            if not status:
-                if not info: info.append({})
-                for l in string.split(output,'\n'):
-                    m = re.match(r'\s*The (?P<p>[\w\d]+) processor operates at',l)
-                    if m:
-                        info[-1]['processor'] = m.group('p')
-                        break
-        except:
-            print sys.exc_value,'(ignoring)'
+        info = command_info(arch='arch',
+                            mach='mach',
+                            uname_i='uname_i',
+                            isainfo_b='isainfo -b',
+                            isainfo_n='isainfo -n',
+                            )
+        info['uname_X'] = key_value_from_command('uname -X', sep='=')
+        for line in command_by_line('psrinfo -v 0'):
+            m = re.match(r'\s*The (?P<p>[\w\d]+) processor operates at', line)
+            if m:
+                info['processor'] = m.group('p')
+                break
         self.__class__.info = info
 
     def _not_impl(self): pass
 
     def _is_32bit(self):
-        return self.info[0]['isainfo_b']=='32'
+        return self.info['isainfo_b']=='32'
     def _is_64bit(self):
-        return self.info[0]['isainfo_b']=='64'
+        return self.info['isainfo_b']=='64'
 
     def _is_i386(self):
-        return self.info[0]['isainfo_n']=='i386'
+        return self.info['isainfo_n']=='i386'
     def _is_sparc(self):
-        return self.info[0]['isainfo_n']=='sparc'
+        return self.info['isainfo_n']=='sparc'
     def _is_sparcv9(self):
-        return self.info[0]['isainfo_n']=='sparcv9'
+        return self.info['isainfo_n']=='sparcv9'
 
     def _getNCPUs(self):
-        try: return int(self.info[0]['uname_X']['NumCPU'])
-        except: return 1
+        return int(self.info['uname_X'].get('NumCPU', 1))
 
     def _is_sun4(self):
-        return self.info[0]['arch']=='sun4'
+        return self.info['arch']=='sun4'
 
     def _is_SUNW(self):
-        return re.match(r'SUNW',self.info[0]['uname_i']) is not None
+        return re.match(r'SUNW',self.info['uname_i']) is not None
     def _is_sparcstation5(self):
-        return re.match(r'.*SPARCstation-5',self.info[0]['uname_i']) is not None
+        return re.match(r'.*SPARCstation-5',self.info['uname_i']) is not None
     def _is_ultra1(self):
-        return re.match(r'.*Ultra-1',self.info[0]['uname_i']) is not None
+        return re.match(r'.*Ultra-1',self.info['uname_i']) is not None
     def _is_ultra250(self):
-        return re.match(r'.*Ultra-250',self.info[0]['uname_i']) is not None
+        return re.match(r'.*Ultra-250',self.info['uname_i']) is not None
     def _is_ultra2(self):
-        return re.match(r'.*Ultra-2',self.info[0]['uname_i']) is not None
+        return re.match(r'.*Ultra-2',self.info['uname_i']) is not None
     def _is_ultra30(self):
-        return re.match(r'.*Ultra-30',self.info[0]['uname_i']) is not None
+        return re.match(r'.*Ultra-30',self.info['uname_i']) is not None
     def _is_ultra4(self):
-        return re.match(r'.*Ultra-4',self.info[0]['uname_i']) is not None
+        return re.match(r'.*Ultra-4',self.info['uname_i']) is not None
     def _is_ultra5_10(self):
-        return re.match(r'.*Ultra-5_10',self.info[0]['uname_i']) is not None
+        return re.match(r'.*Ultra-5_10',self.info['uname_i']) is not None
     def _is_ultra5(self):
-        return re.match(r'.*Ultra-5',self.info[0]['uname_i']) is not None
+        return re.match(r'.*Ultra-5',self.info['uname_i']) is not None
     def _is_ultra60(self):
-        return re.match(r'.*Ultra-60',self.info[0]['uname_i']) is not None
+        return re.match(r'.*Ultra-60',self.info['uname_i']) is not None
     def _is_ultra80(self):
-        return re.match(r'.*Ultra-80',self.info[0]['uname_i']) is not None
+        return re.match(r'.*Ultra-80',self.info['uname_i']) is not None
     def _is_ultraenterprice(self):
-        return re.match(r'.*Ultra-Enterprise',self.info[0]['uname_i']) is not None
+        return re.match(r'.*Ultra-Enterprise',self.info['uname_i']) is not None
     def _is_ultraenterprice10k(self):
-        return re.match(r'.*Ultra-Enterprise-10000',self.info[0]['uname_i']) is not None
+        return re.match(r'.*Ultra-Enterprise-10000',self.info['uname_i']) is not None
     def _is_sunfire(self):
-        return re.match(r'.*Sun-Fire',self.info[0]['uname_i']) is not None
+        return re.match(r'.*Sun-Fire',self.info['uname_i']) is not None
     def _is_ultra(self):
-        return re.match(r'.*Ultra',self.info[0]['uname_i']) is not None
+        return re.match(r'.*Ultra',self.info['uname_i']) is not None
 
     def _is_cpusparcv7(self):
-        return self.info[0]['processor']=='sparcv7'
+        return self.info['processor']=='sparcv7'
     def _is_cpusparcv8(self):
-        return self.info[0]['processor']=='sparcv8'
+        return self.info['processor']=='sparcv8'
     def _is_cpusparcv9(self):
-        return self.info[0]['processor']=='sparcv9'
+        return self.info['processor']=='sparcv9'
 
-class win32_cpuinfo(cpuinfo_base):
+class Win32CPUInfo(CPUInfoBase):
 
     info = None
-    pkey = "HARDWARE\\DESCRIPTION\\System\\CentralProcessor"
+    pkey = r"HARDWARE\DESCRIPTION\System\CentralProcessor"
     # XXX: what does the value of
     #   HKEY_LOCAL_MACHINE\HARDWARE\DESCRIPTION\System\CentralProcessor\0
     # mean?
@@ -512,10 +483,9 @@
         try:
             #XXX: Bad style to use so long `try:...except:...`. Fix it!
             import _winreg
-            pkey = "HARDWARE\\DESCRIPTION\\System\\CentralProcessor"
             prgx = re.compile(r"family\s+(?P<FML>\d+)\s+model\s+(?P<MDL>\d+)"\
                               "\s+stepping\s+(?P<STP>\d+)",re.IGNORECASE)
-            chnd=_winreg.OpenKey(_winreg.HKEY_LOCAL_MACHINE,pkey)
+            chnd=_winreg.OpenKey(_winreg.HKEY_LOCAL_MACHINE, self.pkey)
             pnum=0
             while 1:
                 try:
@@ -574,16 +544,15 @@
         return self.is_AMD() and self.info[0]['Family']==5 \
                and self.info[0]['Model']==9
 
-    def _is_Athlon(self):
-        return self.is_AMD() and self.info[0]['Family']==6
+    def _is_AMDK7(self):
+        return self.is_AMD() and self.info[0]['Family'] == 6
 
-    def _is_Athlon64(self):
-        return self.is_AMD() and self.info[0]['Family']==15 \
-               and self.info[0]['Model']==4
+    # To reliably distinguish between the different types of AMD64 chips
+    # (Athlon64, Operton, Athlon64 X2, Semperon, Turion 64, etc.) would
+    # require looking at the 'brand' from cpuid
 
-    def _is_Opteron(self):
-        return self.is_AMD() and self.info[0]['Family']==15 \
-               and self.info[0]['Model']==5
+    def _is_AMD64(self):
+        return self.is_AMD() and self.info[0]['Family'] == 15
 
     # Intel
 
@@ -624,6 +593,14 @@
     def _is_PentiumIV(self):
         return self.is_Intel() and self.info[0]['Family']==15
 
+    def _is_PentiumM(self):
+        return self.is_Intel() and self.info[0]['Family'] == 6 \
+               and self.info[0]['Model'] in [9, 13, 14]
+
+    def _is_Core2(self):
+        return self.is_Intel() and self.info[0]['Family'] == 6 \
+               and self.info[0]['Model'] in [15, 16, 17]
+
     # Varia
 
     def _is_singleCPU(self):
@@ -638,6 +615,8 @@
                    or (self.info[0]['Family'] in [6,15])
         elif self.is_AMD():
             return self.info[0]['Family'] in [5,6,15]
+        else:
+            return False
 
     def _has_sse(self):
         if self.is_Intel():
@@ -648,32 +627,39 @@
             return (self.info[0]['Family']==6 and \
                     self.info[0]['Model'] in [6,7,8,10]) \
                     or self.info[0]['Family']==15
+        else:
+            return False
 
     def _has_sse2(self):
-        return self.info[0]['Family']==15
+        if self.is_Intel():
+            return self.is_Pentium4() or self.is_PentiumM() \
+                   or self.is_Core2()
+        elif self.is_AMD():
+            return self.is_AMD64()
+        else:
+            return False
 
     def _has_3dnow(self):
-        # XXX: does only AMD have 3dnow??
         return self.is_AMD() and self.info[0]['Family'] in [5,6,15]
 
     def _has_3dnowext(self):
         return self.is_AMD() and self.info[0]['Family'] in [6,15]
 
-if sys.platform[:5] == 'linux': # variations: linux2,linux-i386 (any others?)
-    cpuinfo = linux_cpuinfo
-elif sys.platform[:4] == 'irix':
-    cpuinfo = irix_cpuinfo
+if sys.platform.startswith('linux'): # variations: linux2,linux-i386 (any others?)
+    cpuinfo = LinuxCPUInfo
+elif sys.platform.startswith('irix'):
+    cpuinfo = IRIXCPUInfo
 elif sys.platform == 'darwin':
-    cpuinfo = darwin_cpuinfo
-elif sys.platform[:5] == 'sunos':
-    cpuinfo = sunos_cpuinfo
-elif sys.platform[:5] == 'win32':
-    cpuinfo = win32_cpuinfo
-elif sys.platform[:6] == 'cygwin':
-    cpuinfo = linux_cpuinfo
+    cpuinfo = DarwinCPUInfo
+elif sys.platform.startswith('sunos'):
+    cpuinfo = SunOSCPUInfo
+elif sys.platform.startswith('win32'):
+    cpuinfo = Win32CPUInfo
+elif sys.platform.startswith('cygwin'):
+    cpuinfo = LinuxCPUInfo
 #XXX: other OS's. Eg. use _winreg on Win32. Or os.uname on unices.
 else:
-    cpuinfo = cpuinfo_base
+    cpuinfo = CPUInfoBase
 
 cpu = cpuinfo()
 

Modified: branches/numpy.scons/numpy/distutils/fcompiler/__init__.py
===================================================================
--- branches/numpy.scons/numpy/distutils/fcompiler/__init__.py	2007-11-13 13:10:59 UTC (rev 4450)
+++ branches/numpy.scons/numpy/distutils/fcompiler/__init__.py	2007-11-13 13:51:35 UTC (rev 4451)
@@ -207,7 +207,7 @@
     # This will be set by new_fcompiler when called in
     # command/{build_ext.py, build_clib.py, config.py} files.
     c_compiler = None
-    
+
     def __init__(self, *args, **kw):
         CCompiler.__init__(self, *args, **kw)
         self.distutils_vars = self.distutils_vars.clone(self._environment_hook)

Modified: branches/numpy.scons/numpy/distutils/fcompiler/gnu.py
===================================================================
--- branches/numpy.scons/numpy/distutils/fcompiler/gnu.py	2007-11-13 13:10:59 UTC (rev 4450)
+++ branches/numpy.scons/numpy/distutils/fcompiler/gnu.py	2007-11-13 13:51:35 UTC (rev 4451)
@@ -237,10 +237,13 @@
                 march_opt = '-march=pentium2'
 
         if gnu_ver >= '3.4':
+            # Actually, I think these all do the same things
             if cpu.is_Opteron():
                 march_opt = '-march=opteron'
             elif cpu.is_Athlon64():
                 march_opt = '-march=athlon64'
+            elif cpu.is_AMD64():
+                march_opt = '-march=k8'
 
         if gnu_ver >= '3.4.4':
             if cpu.is_PentiumM():

Modified: branches/numpy.scons/numpy/distutils/misc_util.py
===================================================================
--- branches/numpy.scons/numpy/distutils/misc_util.py	2007-11-13 13:10:59 UTC (rev 4450)
+++ branches/numpy.scons/numpy/distutils/misc_util.py	2007-11-13 13:51:35 UTC (rev 4451)
@@ -116,7 +116,7 @@
     """Return the MATHLIB line from config.h
     """
     if path is None:
-        path = get_numpy_include_dirs()[0]
+        path = os.path.join(get_numpy_include_dirs()[0], 'numpy')
     config_file = os.path.join(path,'config.h')
     fid = open(config_file)
     mathlibs = []

Modified: branches/numpy.scons/numpy/distutils/system_info.py
===================================================================
--- branches/numpy.scons/numpy/distutils/system_info.py	2007-11-13 13:10:59 UTC (rev 4450)
+++ branches/numpy.scons/numpy/distutils/system_info.py	2007-11-13 13:51:35 UTC (rev 4451)
@@ -143,7 +143,18 @@
                             '/opt/include', '/usr/include',
                             '/opt/local/include', '/sw/include']
     default_src_dirs = ['.','/usr/local/src', '/opt/src','/sw/src']
-    default_x11_lib_dirs = ['/usr/X11R6/lib','/usr/X11/lib','/usr/lib']
+
+    try:
+        platform = os.uname()
+        bit64 = platform[-1].endswith('64')
+    except:
+        bit64 = False
+
+    if bit64:
+        default_x11_lib_dirs = ['/usr/lib64']
+    else:
+        default_x11_lib_dirs = ['/usr/X11R6/lib','/usr/X11/lib','/usr/lib']
+
     default_x11_include_dirs = ['/usr/X11R6/include','/usr/X11/include',
                                 '/usr/include']
 
@@ -830,7 +841,7 @@
             lapack_libs = self.get_libs('lapack_libs',['mkl_lapack'])
         else:
             lapack_libs = self.get_libs('lapack_libs',['mkl_lapack32','mkl_lapack64'])
-            
+
         info = {'libraries': lapack_libs}
         dict_append(info,**mkl)
         self.set_info(**info)
@@ -1073,7 +1084,7 @@
         tgexc tgsen tgsja tgsna tgsy2 tgsyl tpcon tprfs tptri tptrs
         trcon trevc trexc trrfs trsen trsna trsyl trti2 trtri trtrs
         tzrqf tzrzf
-        
+
         lacn2 lahr2 stemr laqr0 laqr1 laqr2 laqr3 laqr4 laqr5
         ''' # [s|c|d|z]*.f
         sd_lasrc = '''

Modified: branches/numpy.scons/numpy/distutils/tests/f2py_ext/tests/test_fib2.py
===================================================================
--- branches/numpy.scons/numpy/distutils/tests/f2py_ext/tests/test_fib2.py	2007-11-13 13:10:59 UTC (rev 4450)
+++ branches/numpy.scons/numpy/distutils/tests/f2py_ext/tests/test_fib2.py	2007-11-13 13:51:35 UTC (rev 4451)
@@ -4,7 +4,7 @@
 from f2py_ext import fib2
 del sys.path[0]
 
-class test_fib2(NumpyTestCase):
+class TestFib2(NumpyTestCase):
 
     def check_fib(self):
         assert_array_equal(fib2.fib(6),[0,1,1,2,3,5])

Modified: branches/numpy.scons/numpy/distutils/tests/f2py_f90_ext/tests/test_foo.py
===================================================================
--- branches/numpy.scons/numpy/distutils/tests/f2py_f90_ext/tests/test_foo.py	2007-11-13 13:10:59 UTC (rev 4450)
+++ branches/numpy.scons/numpy/distutils/tests/f2py_f90_ext/tests/test_foo.py	2007-11-13 13:51:35 UTC (rev 4451)
@@ -4,7 +4,7 @@
 from f2py_f90_ext import foo
 del sys.path[0]
 
-class test_foo(NumpyTestCase):
+class TestFoo(NumpyTestCase):
 
     def check_foo_free(self):
         assert_equal(foo.foo_free.bar13(),13)

Modified: branches/numpy.scons/numpy/distutils/tests/gen_ext/tests/test_fib3.py
===================================================================
--- branches/numpy.scons/numpy/distutils/tests/gen_ext/tests/test_fib3.py	2007-11-13 13:10:59 UTC (rev 4450)
+++ branches/numpy.scons/numpy/distutils/tests/gen_ext/tests/test_fib3.py	2007-11-13 13:51:35 UTC (rev 4451)
@@ -4,7 +4,7 @@
 from gen_ext import fib3
 del sys.path[0]
 
-class test_fib3(NumpyTestCase):
+class TestFib3(NumpyTestCase):
 
     def check_fib(self):
         assert_array_equal(fib3.fib(6),[0,1,1,2,3,5])

Modified: branches/numpy.scons/numpy/distutils/tests/pyrex_ext/tests/test_primes.py
===================================================================
--- branches/numpy.scons/numpy/distutils/tests/pyrex_ext/tests/test_primes.py	2007-11-13 13:10:59 UTC (rev 4450)
+++ branches/numpy.scons/numpy/distutils/tests/pyrex_ext/tests/test_primes.py	2007-11-13 13:51:35 UTC (rev 4451)
@@ -5,7 +5,7 @@
 from pyrex_ext.primes import primes
 restore_path()
 
-class test_primes(NumpyTestCase):
+class TestPrimes(NumpyTestCase):
     def check_simple(self, level=1):
         l = primes(10)
         assert_equal(l, [2, 3, 5, 7, 11, 13, 17, 19, 23, 29])

Modified: branches/numpy.scons/numpy/distutils/tests/swig_ext/tests/test_example.py
===================================================================
--- branches/numpy.scons/numpy/distutils/tests/swig_ext/tests/test_example.py	2007-11-13 13:10:59 UTC (rev 4450)
+++ branches/numpy.scons/numpy/distutils/tests/swig_ext/tests/test_example.py	2007-11-13 13:51:35 UTC (rev 4451)
@@ -4,7 +4,7 @@
 from swig_ext import example
 restore_path()
 
-class test_example(NumpyTestCase):
+class TestExample(NumpyTestCase):
 
     def check_fact(self):
         assert_equal(example.fact(10),3628800)

Modified: branches/numpy.scons/numpy/distutils/tests/swig_ext/tests/test_example2.py
===================================================================
--- branches/numpy.scons/numpy/distutils/tests/swig_ext/tests/test_example2.py	2007-11-13 13:10:59 UTC (rev 4450)
+++ branches/numpy.scons/numpy/distutils/tests/swig_ext/tests/test_example2.py	2007-11-13 13:51:35 UTC (rev 4451)
@@ -4,7 +4,7 @@
 from swig_ext import example2
 restore_path()
 
-class test_example2(NumpyTestCase):
+class TestExample2(NumpyTestCase):
 
     def check_zoo(self):
         z = example2.Zoo()

Modified: branches/numpy.scons/numpy/distutils/tests/test_fcompiler_gnu.py
===================================================================
--- branches/numpy.scons/numpy/distutils/tests/test_fcompiler_gnu.py	2007-11-13 13:10:59 UTC (rev 4450)
+++ branches/numpy.scons/numpy/distutils/tests/test_fcompiler_gnu.py	2007-11-13 13:51:35 UTC (rev 4451)
@@ -21,7 +21,7 @@
     ('GNU Fortran (GCC) 4.3.0 20070316 (experimental)', '4.3.0'),
 ]
 
-class test_g77_versions(NumpyTestCase):
+class TestG77Versions(NumpyTestCase):
     def test_g77_version(self):
         fc = numpy.distutils.fcompiler.new_fcompiler(compiler='gnu')
         for vs, version in g77_version_strings:
@@ -34,7 +34,7 @@
             v = fc.version_match(vs)
             assert v is None, (vs, v)
 
-class test_gortran_versions(NumpyTestCase):
+class TestGortranVersions(NumpyTestCase):
     def test_gfortran_version(self):
         fc = numpy.distutils.fcompiler.new_fcompiler(compiler='gnu95')
         for vs, version in gfortran_version_strings:

Modified: branches/numpy.scons/numpy/distutils/tests/test_misc_util.py
===================================================================
--- branches/numpy.scons/numpy/distutils/tests/test_misc_util.py	2007-11-13 13:10:59 UTC (rev 4450)
+++ branches/numpy.scons/numpy/distutils/tests/test_misc_util.py	2007-11-13 13:51:35 UTC (rev 4451)
@@ -8,7 +8,7 @@
 
 ajoin = lambda *paths: join(*((sep,)+paths))
 
-class test_appendpath(NumpyTestCase):
+class TestAppendpath(NumpyTestCase):
 
     def check_1(self):
         assert_equal(appendpath('prefix','name'),join('prefix','name'))
@@ -32,7 +32,7 @@
         assert_equal(appendpath('/prefix/sub/sub2','/prefix/sub/sup/name'),
                      ajoin('prefix','sub','sub2','sup','name'))
 
-class test_minrelpath(NumpyTestCase):
+class TestMinrelpath(NumpyTestCase):
 
     def check_1(self):
         import os
@@ -47,7 +47,7 @@
         assert_equal(minrelpath(n('.././..')),n('../..'))
         assert_equal(minrelpath(n('aa/bb/.././../dd')),n('dd'))
 
-class test_gpaths(NumpyTestCase):
+class TestGpaths(NumpyTestCase):
 
     def check_gpaths(self):
         local_path = minrelpath(os.path.join(os.path.dirname(__file__),'..'))

Modified: branches/numpy.scons/numpy/doc/CAPI.txt
===================================================================
--- branches/numpy.scons/numpy/doc/CAPI.txt	2007-11-13 13:10:59 UTC (rev 4450)
+++ branches/numpy.scons/numpy/doc/CAPI.txt	2007-11-13 13:51:35 UTC (rev 4451)
@@ -3,9 +3,11 @@
 ===============
 
 :Author:          Travis Oliphant
-:Discussions to:  scipy-dev@scipy.org
+:Discussions to:  `numpy-discussion@scipy.org`__
 :Created:         October 2005
 
+__ http://www.scipy.org/Mailing_Lists
+
 The C API of NumPy is (mostly) backward compatible with Numeric.
 
 There are a few non-standard Numeric usages (that were not really part

Modified: branches/numpy.scons/numpy/doc/DISTUTILS.txt
===================================================================
--- branches/numpy.scons/numpy/doc/DISTUTILS.txt	2007-11-13 13:10:59 UTC (rev 4450)
+++ branches/numpy.scons/numpy/doc/DISTUTILS.txt	2007-11-13 13:51:35 UTC (rev 4451)
@@ -34,39 +34,37 @@
 '''''''''''''''''''''''''''''''
 
 SciPy consists of Python packages, called SciPy packages, that are
-available to Python users via ``scipy`` name space. Each SciPy package
-may contain other SciPy packages. And so on. So, SciPy directory tree
-is a tree of packages with arbitrary depth and width. Any SciPy
-package may depend on NumPy packages but the dependence on other
+available to Python users via the ``scipy`` namespace. Each SciPy package
+may contain other SciPy packages. And so on. Therefore, the SciPy 
+directory tree is a tree of packages with arbitrary depth and width. 
+Any SciPy package may depend on NumPy packages but the dependence on other
 SciPy packages should be kept minimal or zero.
 
-A SciPy package contains in addition to its sources, the following
+A SciPy package contains, in addition to its sources, the following
 files and directories:
 
-  ``setup.py`` --- building script
-  ``info.py``  --- contains documentation and import flags
-  ``__init__.py`` --- package initializer
-  ``tests/`` --- directory of unittests
+  + ``setup.py`` --- building script
+  + ``info.py``  --- contains documentation and import flags
+  + ``__init__.py`` --- package initializer
+  + ``tests/`` --- directory of unittests
 
-Their contents will be described below.
+Their contents are described below.
 
 The ``setup.py`` file
 '''''''''''''''''''''
 
-In order to add a Python package to SciPy, its building script (the
-``setup.py`` file) must meet certain requirements. The minimal and the
-most important one is that it must define a function
-``configuration(parent_package='',top_path=None)`` that returns a
-dictionary suitable for passing to ``numpy.distutils.core.setup(..)``
-function. In order to simplify the construction of such an distionary,
-``numpy.distutils.misc_util`` provides a class ``Configuration``, the
-usage of will be described below.
+In order to add a Python package to SciPy, its build script (``setup.py``) 
+must meet certain requirements. The most important requirement is that the 
+package define a ``configuration(parent_package='',top_path=None)`` function 
+which returns a dictionary suitable for passing to 
+``numpy.distutils.core.setup(..)``. To simplify the construction of 
+this dictionary, ``numpy.distutils.misc_util`` provides the 
+``Configuration`` class, described below.
 
 SciPy pure Python package example
 ---------------------------------
 
-Here follows a minimal example for a pure Python SciPy package
-``setup.py`` file that will be explained in detail below::
+Below is an example of a minimal ``setup.py`` file for a pure Scipy package::
 
   #!/usr/bin/env python
   def configuration(parent_package='',top_path=None):
@@ -79,16 +77,15 @@
       #setup(**configuration(top_path='').todict())
       setup(configuration=configuration)
 
-The first argument ``parent_package`` of the main configuration
-function will contain a name of the parent SciPy package and the
-second argument ``top_path`` contains the name of the directory where
-the main ``setup.py`` script is located. Both arguments should be
-passed to the ``Configuration`` constructor after the name of the
-current package.
+The arguments of the ``configuration`` function specifiy the name of
+parent SciPy package (``parent_package``) and the directory location
+of the main ``setup.py`` script (``top_path``).  These arguments, 
+along with the name of the current package, should be passed to the
+``Configuration`` constructor.
 
-The ``Configuration`` constructor has also fourth optional argument,
+The ``Configuration`` constructor has a fourth optional argument,
 ``package_path``, that can be used when package files are located in
-some other location than the directory of the ``setup.py`` file. 
+a different location than the directory of the ``setup.py`` file. 
 
 Remaining ``Configuration`` arguments are all keyword arguments that will
 be used to initialize attributes of ``Configuration``
@@ -122,7 +119,7 @@
 ``Configuration`` instance methods
 ----------------------------------
 
-+ ``config.todict()`` --- returns configuration distionary suitable for
++ ``config.todict()`` --- returns configuration dictionary suitable for
   passing to ``numpy.distutils.core.setup(..)`` function.
 
 + ``config.paths(*paths) --- applies ``glob.glob(..)`` to items of
@@ -409,12 +406,12 @@
 The ``info.py`` file
 ''''''''''''''''''''
 
-Scipy package import hooks assume that each Scipy package contains
-``info.py`` file that contains overall documentation about the package
-and some variables defining the order of package imports, dependence
+Scipy package import hooks assume that each package contains a
+``info.py`` file.  This file contains overall documentation about the package
+and variables defining the order of package imports, dependency
 relations between packages, etc.
 
-The following information will be looked in the ``info.py`` file:
+On import, the following information will be looked for in ``info.py``:
 
 __doc__
   The documentation string of the package.
@@ -444,15 +441,14 @@
 The ``__init__.py`` file
 ''''''''''''''''''''''''
 
-To speed up the import time as well as to minimize memory usage, numpy
-uses ppimport hooks to transparently postpone importing large modules
-that might not be used during the Scipy usage session. But in order to
-have an access to the documentation of all Scipy packages, including 
-of the postponed packages, the documentation string of a package (that would
-usually reside in ``__init__.py`` file) should be copied also
-to ``info.py`` file.
+To speed up the import time and minimize memory usage, numpy
+uses ``ppimport`` hooks to transparently postpone importing large modules,
+which might not be used during the Scipy session. In order to
+have access to the documentation of all Scipy packages, including 
+postponed packages, the docstring from ``info.py`` is imported
+into ``__init__.py``.
 
-So, the header a typical ``__init__.py`` file is::
+The header of a typical ``__init__.py`` is::
 
   #
   # Package ... - ...

Modified: branches/numpy.scons/numpy/doc/HOWTO_DOCUMENT.txt
===================================================================
--- branches/numpy.scons/numpy/doc/HOWTO_DOCUMENT.txt	2007-11-13 13:10:59 UTC (rev 4450)
+++ branches/numpy.scons/numpy/doc/HOWTO_DOCUMENT.txt	2007-11-13 13:51:35 UTC (rev 4451)
@@ -1,33 +1,49 @@
-=================================
-A Guide to NumPy/SciPy Docstrings
-=================================
+====================================
+A Guide to NumPy/SciPy Documentation
+====================================
 
 .. Contents::
 
 Overview
 --------
+In general, we follow the standard Python style conventions as described here:
+ * `Style Guide for C Code <http://www.python.org/peps/pep-0007.html>`__
+ * `Style Guide for Python Code <http://www.python.org/peps/pep-0008.html>`__
+ * `Docstring Conventions <http://www.python.org/peps/pep-0257.html>`__
 
+Additional PEPs of interest regarding documentation of code:
+ * `Docstring Processing Framework <http://www.python.org/peps/pep-0256.html>`__
+ * `Docutils Design Specification <http://www.python.org/peps/pep-0258.html>`__
+
+Use a code checker:
+ * `pylint <http://www.logilab.org/857>`__
+ * `pep8.py <http://svn.browsershots.org/trunk/devtools/pep8/pep8.py>`__
+
+Docstring Standard
+------------------
+
 A documentation string (docstring) is a string that describes a module,
 function, class, or method definition.  The docstring is a special attribute
 of the object (``object.__doc__``) and, for consistency, is surrounded by
-triple double quotes. 
+triple double quotes.
 
-Obviously, it is highly desireable that both NumPy and SciPy follow a common
-convention for docstrings that provide for consistency while also allowing
-epydoc to produce nicely-formatted reference guides.  This document describes
-the current community consensus for this standard.  If you have suggestions
-for improvements, post them on the numpy-dev list together with the epydoc
-output so they may be discussed.
+It is highly desireable that both NumPy and SciPy_ follow a common
+convention for docstrings that provide for consistency while also
+allowing epydoc_ to produce nicely-formatted reference guides.  This
+document describes the current community consensus for this standard.
+If you have suggestions for improvements, post them on the
+`numpy-discussion list`_, together with the epydoc output.
 
-Our docstring standard uses `reST <http://docutils.sourceforge.net/rst.html>`__
-syntax and is rendered using `epydoc <http://epydoc.sourceforge.net/>`__. The
-markup in this proposal is as basic as possible and in particular avoids the
-use of epydoc consolidated fields. This is both because there are a limited
-number of such fields, inadequate to our current needs, and because epydoc
-moves the fields to the end of the documentation, messing up the ordering. So
-here standard definition lists are used instead.  Likewise, epydoc moves
-headings and have an unwelcome size in the default style sheet, hence they
-have also been avoided.
+Our docstring standard uses `reST
+<http://docutils.sourceforge.net/rst.html>`__ syntax and is rendered
+using epydoc_. The markup in this proposal is as basic as possible
+and, in particular, avoids the use of epydoc consolidated fields. This
+is both because there are a limited number of such fields, inadequate
+to our current needs, and because epydoc moves the fields to the end
+of the documentation, messing up the ordering.  Standard definition
+lists are used instead.  Likewise, epydoc moves headings and have an
+unwelcome size in the default style sheet, therefore they are also
+avoided.
 
 
 Status
@@ -37,11 +53,11 @@
 
 1. Agree on docstring standards.
 
-2. Work with Ed loper to ensure that epydoc provides the functionality we
-need.
+2. Work with Ed loper to ensure that epydoc_ provides the functionality
+   we need.
 
-3. Convert existing docstrings to the new format and write them for those
-that currently lack docstrings.
+3. Convert existing docstrings to the new format and write them for
+   those that currently lack docstrings.
 
 
 Sections
@@ -50,50 +66,60 @@
 The proposed sections of the docstring are:
 
 1. **Short summary:**
-A one-line summary not using variable names or the function name (unless a
-C-function).
+   A one-line summary not using variable names or the function name
+   (unless a C-function).
 
 2. **Extended summary:**
-A few sentences giving an extended description.
+   A few sentences giving an extended description.
 
 3. **Parameters:**
+   Description of the function arguments, keywords and their
+   respective types.
 
-4. **Returns:**'
+4. **Returns:**
+   Explanation of the returned values and their types.
 
 5. **Other parameters:**
-An optional section used to describe little used
-parameters so that functions with a large number of keyword argument can still
-be well documented without cluttering the main parameters' list.
+   An optional section used to describe little used parameters so that
+   functions with a large number of keyword argument can still be well
+   documented without cluttering the main parameters' list.
 
 6. **See also:**
-An optional section used to refer to related code.  This section can be
-extremely useful, but needs to be used with caution.  It can be difficult
-to maintain and if not used judiciously this section can quickly loose its
-usefulness.  The purpose of this section is to direct users to other
-functions they may not be aware of or have easy means to discover (i.e.,
-by looking at the docstring of the module).  Thus, repeating functions
-that are in the same module is not useful and can create a cluttered
-document.  Routines that provide additional information in their
-docstrings for this function may be useful to include here.
+   An optional section used to refer to related code.  This section
+   can be very useful, but should be used judiciously.  The goal is to
+   direct users to other functions they may not be aware of, or have
+   easy means of discovering (by looking at the module docstring, for
+   example).  Routines whose docstrings further explain parameters
+   used by this function are good candidates.
 
 7. **Notes:**
-An optional section that provides additional information
-about the code possibly including a discussion or presentation of the
-algorithm. This section may include mathematical equations possibly written
-in `LaTeX <http://www.latex-project.org/>`__.
+   An optional section that provides additional information about the
+   code, possibly including a discussion of the algorithm. This
+   section may include mathematical equations, possibly written in
+   `LaTeX <http://www.latex-project.org/>`__.
 
 8. **Examples:**
-An optional section for examples using the
-`doctest <http://www.python.org/doc/lib/module-doctest.html>`__ format.  It
-can provide an inline mini-tutorial as well as additional regression testing.
-While optional, this section is strongly encouraged.  (Comment by Chuck:
-blank lines in the numpy output, for instance in multidimensional arrays,
-will break doctest.) You can run the tests by doing::
+   An optional section for examples, using the `doctest
+   <http://www.python.org/doc/lib/module-doctest.html>`__ format.  It
+   can provide an inline mini-tutorial as well as additional
+   regression testing.  While optional, this section is strongly
+   encouraged. You can run the tests by doing::
 
-  >>> import doctest
-  >>> doctest.testfile('example.py')
+     >>> import doctest
+     >>> doctest.testfile('example.py')
 
+   Blank lines are used to seperate doctests.  When they occur in the
+   expected output, they should be replaced by ``<BLANKLINE>`` (see
+   `doctest options
+   <http://docs.python.org/lib/doctest-options.html>`_), e.g.
 
+   ::
+
+     >>> print "a\n\nb"
+     a
+     <BLANKLINE>
+     b
+
 Common reST concepts
 --------------------
 
@@ -101,10 +127,10 @@
 
   __docformat__ = 'restructuredtext en'
 
-at the top level in accordance with
-`PEP 258 <http://www.python.org/dev/peps/pep-0258>`__.  Note that the
-__docformat__ variable in a package's __init__.py file does not apply to
-objects defined in subpackages and submodules.
+at the top level in accordance with `PEP 258
+<http://www.python.org/dev/peps/pep-0258>`__.  Note that the
+``__docformat__`` variable in a package's ``__init__.py`` file does
+not apply to objects defined in subpackages and submodules.
 
 For paragraphs, indentation is significant and indicates indentation in the
 output. New paragraphs are marked with blank line.
@@ -123,12 +149,11 @@
 
 
 
-Using Epydoc
-------------
+Using Epydoc_
+-------------
 
+Currently, we recommend that you build epydoc from the trunk::
 
-Currently we recommend that you build eydoc from the trunk::
-
   svn co https://epydoc.svn.sourceforge.net/svnroot/epydoc/trunk/epydoc epydoc
   cd epydoc/src
   sudo python setup.py install
@@ -153,21 +178,39 @@
 Use optional in the "type" field for parameters that are non-keyword
 optional for C-functions.
 
+Epydoc depends on Docutils for reStructuredText parsing.  You can download
+Docutils from the 
+`Docutils sourceforge page. <http://docutils.sourceforge.net/>`__
+You may also be able to use a package manager like yum to install a 
+current version::
+
+  $ sudo yum install python-docutils
+
+
 Example
 -------
 
-Here is a short example module in
+Here is a short example module,
 `plain text <http://svn.scipy.org/svn/numpy/trunk/numpy/doc/example.py>`__
-and
-`rendered <http://www.scipy.org/doc/example>`__
+or
+`rendered <http://www.scipy.org/doc/example>`__ in HTML.
 
 To try this yourself, simply download the example.py::
 
   svn co http://svn.scipy.org/svn/numpy/trunk/numpy/doc/example.py .
 
-You can run epydoc on this file like so::
+Then, run epydoc::
 
   $ epydoc example.txt
 
-The output will be in a directory named html in the same directory as this
-document and may be viewed by loading the index.html file into your browser.
+The output is placed in ``./html``, and may be viewed by loading the
+``index.html`` file into your browser.
+
+This document itself was written in ReStructuredText, and may be converted to
+HTML using::
+
+  $ rst2html HOWTO_DOCUMENT.txt HOWTO_DOCUMENT.html
+
+.. _SciPy: http://www.scipy.org
+.. _numpy-discussion list: http://www.scipy.org/Mailing_Lists
+.. _epydoc: http://epydoc.sourceforge.net/

Modified: branches/numpy.scons/numpy/doc/example.py
===================================================================
--- branches/numpy.scons/numpy/doc/example.py	2007-11-13 13:10:59 UTC (rev 4450)
+++ branches/numpy.scons/numpy/doc/example.py	2007-11-13 13:51:35 UTC (rev 4451)
@@ -96,4 +96,3 @@
     """
 
     pass
-

Modified: branches/numpy.scons/numpy/doc/pep_buffer.txt
===================================================================
--- branches/numpy.scons/numpy/doc/pep_buffer.txt	2007-11-13 13:10:59 UTC (rev 4450)
+++ branches/numpy.scons/numpy/doc/pep_buffer.txt	2007-11-13 13:51:35 UTC (rev 4451)
@@ -1,13 +1,13 @@
-PEP: 3118
-Title: Revising the buffer protocol
-Version: $Revision$
-Last-Modified: $Date$
-Authors: Travis Oliphant <oliphant@ee.byu.edu>, Carl Banks <pythondev@aerojockey.com>
-Status: Draft
-Type: Standards Track
-Content-Type: text/x-rst
-Created: 28-Aug-2006
-Python-Version: 3000
+:PEP: 3118
+:Title: Revising the buffer protocol
+:Version: $Revision$
+:Last-Modified: $Date$
+:Authors: Travis Oliphant <oliphant@ee.byu.edu>, Carl Banks <pythondev@aerojockey.com>
+:Status: Draft
+:Type: Standards Track
+:Content-Type: text/x-rst
+:Created: 28-Aug-2006
+:Python-Version: 3000
 
 Abstract
 ========
@@ -16,17 +16,17 @@
 function pointers) to improve the way Python allows memory sharing
 in Python 3.0
 
-In particular, it is proposed that the character buffer portion 
-of the API be elminated and the multiple-segment portion be 
+In particular, it is proposed that the character buffer portion
+of the API be elminated and the multiple-segment portion be
 re-designed in conjunction with allowing for strided memory
-to be shared.   In addition, the new buffer interface will 
+to be shared.   In addition, the new buffer interface will
 allow the sharing of any multi-dimensional nature of the
-memory and what data-format the memory contains. 
+memory and what data-format the memory contains.
 
-This interface will allow any extension module to either 
+This interface will allow any extension module to either
 create objects that share memory or create algorithms that
-use and manipulate raw memory from arbitrary objects that 
-export the interface. 
+use and manipulate raw memory from arbitrary objects that
+export the interface.
 
 
 Rationale
@@ -39,7 +39,7 @@
 has issues:
 
 1. There is the little used "sequence-of-segments" option
-   (bf_getsegcount) that is not well motivated. 
+   (bf_getsegcount) that is not well motivated.
 
 2. There is the apparently redundant character-buffer option
    (bf_getcharbuffer)
@@ -62,36 +62,36 @@
    Libraries, ctypes, NumPy, data-base interfaces, etc.)
 
 6. There is no way to share discontiguous memory (except through
-   the sequence of segments notion).  
+   the sequence of segments notion).
 
    There are two widely used libraries that use the concept of
    discontiguous memory: PIL and NumPy.  Their view of discontiguous
    arrays is different, though.  The proposed buffer interface allows
-   sharing of either memory model.  Exporters will use only one        
-   approach and consumers may choose to support discontiguous 
-   arrays of each type however they choose. 
+   sharing of either memory model.  Exporters will use only one
+   approach and consumers may choose to support discontiguous
+   arrays of each type however they choose.
 
    NumPy uses the notion of constant striding in each dimension as its
    basic concept of an array. With this concept, a simple sub-region
-   of a larger array can be described without copying the data.   
+   of a larger array can be described without copying the data.
    Thus, stride information is the additional information that must be
-   shared. 
+   shared.
 
    The PIL uses a more opaque memory representation. Sometimes an
    image is contained in a contiguous segment of memory, but sometimes
    it is contained in an array of pointers to the contiguous segments
    (usually lines) of the image.  The PIL is where the idea of multiple
-   buffer segments in the original buffer interface came from.   
+   buffer segments in the original buffer interface came from.
 
    NumPy's strided memory model is used more often in computational
    libraries and because it is so simple it makes sense to support
-   memory sharing using this model.  The PIL memory model is sometimes 
+   memory sharing using this model.  The PIL memory model is sometimes
    used in C-code where a 2-d array can be then accessed using double
-   pointer indirection:  e.g. image[i][j].  
+   pointer indirection:  e.g. image[i][j].
 
    The buffer interface should allow the object to export either of these
    memory models.  Consumers are free to either require contiguous memory
-   or write code to handle one or both of these memory models. 
+   or write code to handle one or both of these memory models.
 
 Proposal Overview
 =================
@@ -102,7 +102,7 @@
 * Unify the read/write versions of getting the buffer.
 
 * Add a new function to the interface that should be called when
-  the consumer object is "done" with the memory area.  
+  the consumer object is "done" with the memory area.
 
 * Add a new variable to allow the interface to describe what is in
   memory (unifying what is currently done now in struct and
@@ -112,8 +112,8 @@
 
 * Add a new variable for sharing stride information
 
-* Add a new mechanism for sharing arrays that must 
-  be accessed using pointer indirection. 
+* Add a new mechanism for sharing arrays that must
+  be accessed using pointer indirection.
 
 * Fix all objects in the core and the standard library to conform
   to the new interface
@@ -121,10 +121,10 @@
 * Extend the struct module to handle more format specifiers
 
 * Extend the buffer object into a new memory object which places
-  a Python veneer around the buffer interface. 
+  a Python veneer around the buffer interface.
 
 * Add a few functions to make it easy to copy contiguous data
-  in and out of object supporting the buffer interface. 
+  in and out of object supporting the buffer interface.
 
 Specification
 =============
@@ -151,7 +151,7 @@
 
 ::
 
-    typedef int (*getbufferproc)(PyObject *obj, PyBuffer *view, int flags) 
+    typedef int (*getbufferproc)(PyObject *obj, PyBuffer *view, int flags)
 
 This function returns 0 on success and -1 on failure (and raises an
 error). The first variable is the "exporting" object.  The second
@@ -167,29 +167,29 @@
 
 The exporter can use this information to simplify how much of the PyBuffer
 structure is filled in and/or raise an error if the object can't support
-a simpler view of its memory. 
+a simpler view of its memory.
 
 Thus, the caller can request a simple "view" and either receive it or
 have an error raised if it is not possible.
 
 All of the following assume that at least buf, len, and readonly
-will always be utilized by the caller.  
+will always be utilized by the caller.
 
-Py_BUF_SIMPLE 
+Py_BUF_SIMPLE
 
    The returned buffer will be assumed to be readable (the object may
    or may not have writeable memory).  Only the buf, len, and readonly
    variables may be accessed. The format will be assumed to be
    unsigned bytes .  This is a "stand-alone" flag constant.  It never
-   needs to be |'d to the others.  The exporter will raise an 
-   error if it cannot provide such a contiguous buffer. 
+   needs to be \|'d to the others.  The exporter will raise an
+   error if it cannot provide such a contiguous buffer.
 
 Py_BUF_WRITEABLE
 
    The returned buffer must be writeable.  If it is not writeable,
    then raise an error.
 
-Py_BUF_READONLY 
+Py_BUF_READONLY
 
    The returned buffer must be readonly.  If the object is already
    read-only or it can make its memory read-only (and there are no
@@ -198,32 +198,32 @@
    (or cannot make it read-only), then an error should be raised.
 
 Py_BUF_FORMAT
-        
-   The returned buffer must have true format information.  This would 
+
+   The returned buffer must have true format information.  This would
    be used when the consumer is going to be checking for what 'kind'
    of data is actually stored.  An exporter should always be able
-   to provide this information if requested. 
+   to provide this information if requested.
 
-Py_BUF_SHAPE 
+Py_BUF_SHAPE
 
    The returned buffer must have shape information.  The memory will
    be assumed C-style contiguous (last dimension varies the fastest).
-   The exporter may raise an error if it cannot provide this kind 
-   of contiguous buffer. 
-   
-Py_BUF_STRIDES (implies Py_BUF_SHAPE) 
+   The exporter may raise an error if it cannot provide this kind
+   of contiguous buffer.
 
+Py_BUF_STRIDES (implies Py_BUF_SHAPE)
+
    The returned buffer must have strides information. This would be
-   used when the consumer can handle strided, discontiguous arrays. 
-   Handling strides automatically assumes you can handle shape. 
+   used when the consumer can handle strided, discontiguous arrays.
+   Handling strides automatically assumes you can handle shape.
    The exporter may raise an error if cannot provide a strided-only
-   representation of the data (i.e. without the suboffsets). 
+   representation of the data (i.e. without the suboffsets).
 
 Py_BUF_OFFSETS (implies Py_BUF_STRIDES)
 
    The returned buffer must have suboffsets information.  This would
    be used when the consumer can handle indirect array referencing
-   implied by these suboffsets.  
+   implied by these suboffsets.
 
 Py_BUF_FULL (Py_BUF_OFFSETS | Py_BUF_WRITEABLE | Py_BUF_FORMAT)
 
@@ -232,7 +232,7 @@
 how to make use of the most complicated cases could use Py_BUF_INDIRECT.
 
 If format information is going to be probed, then Py_BUF_FORMAT must
-be |'d to the flags otherwise the consumer assumes it is unsigned
+be \|'d to the flags otherwise the consumer assumes it is unsigned
 bytes.
 
 There is a C-API that simple exporting objects can use to fill-in the
@@ -268,7 +268,7 @@
 buf
     a pointer to the start of the memory for the object
 
-len 
+len
     the total bytes of memory the object uses.  This should be the
     same as the product of the shape array multiplied by the number of
     bytes per item of memory.
@@ -278,7 +278,7 @@
     readonly.  1 means the memory is readonly, zero means the
     memory is writeable.
 
-format 
+format
     a NULL-terminated format-string (following the struct-style syntax
     including extensions) indicating what is in each element of
     memory.  The number of elements is len / itemsize, where itemsize
@@ -287,7 +287,7 @@
 
 ndims
     a variable storing the number of dimensions the memory represents.
-    Must be >=0. 
+    Must be >=0.
 
 shape
     an array of ``Py_ssize_t`` of length ``ndims`` indicating the
@@ -295,7 +295,7 @@
     ... * (*shape)[ndims-1])*itemsize = len``.  If ndims is 0 (indicating
     a scalar), then this must be NULL.
 
-strides 
+strides
     address of a ``Py_ssize_t*`` variable that will be filled with a
     pointer to an array of ``Py_ssize_t`` of length ``ndims`` (or NULL
     if ndims is 0).  indicating the number of bytes to skip to get to
@@ -314,7 +314,7 @@
     indicated dimension is a pointer and the suboffset value dictates
     how many bytes to add to the pointer after de-referencing.  A
     suboffset value that it negative indicates that no de-referencing
-    should occur (striding in a contiguous memory block).  If all 
+    should occur (striding in a contiguous memory block).  If all
     suboffsets are negative (i.e. no de-referencing is needed, then
     this must be NULL.
 
@@ -339,22 +339,22 @@
     Thus slicing in the ith dimension would add to the suboffsets in
     the (i-1)st dimension.  Slicing in the first dimension would change
     the location of the starting pointer directly (i.e. buf would
-    be modified).  
+    be modified).
 
 itemsize
     This is a storage for the itemsize of each element of the shared
     memory.  It can be obtained using PyBuffer_SizeFromFormat but an
     exporter may know it without making this call and thus storing it
-    is more convenient and faster. 
+    is more convenient and faster.
 
 internal
     This is for use internally by the exporting object.  For example,
-    this might be re-cast as an integer by the exporter and used to 
+    this might be re-cast as an integer by the exporter and used to
     store flags about whether or not the shape, strides, and suboffsets
     arrays must be freed when the buffer is released.   The consumer
-    should never touch this value. 
-    
+    should never touch this value.
 
+
 The exporter is responsible for making sure the memory pointed to by
 buf, format, shape, strides, and suboffsets is valid until
 releasebuffer is called.  If the exporter wants to be able to change
@@ -366,7 +366,7 @@
 
 The same bufferinfo struct should be used in the release-buffer
 interface call. The caller is responsible for the memory of the
-bufferinfo structure itself. 
+bufferinfo structure itself.
 
 ``typedef int (*releasebufferproc)(PyObject *obj, PyBuffer *view)``
     Callers of getbufferproc must make sure that this function is
@@ -378,8 +378,8 @@
     Both of these routines are optional for a type object
 
     If the releasebuffer function is not provided then it does not ever
-    need to be called. 
-    
+    need to be called.
+
 Exporters will need to define a releasebuffer function if they can
 re-allocate their memory, strides, shape, suboffsets, or format
 variables which they might share through the struct bufferinfo.
@@ -387,7 +387,7 @@
 calls have been made and shared.  Either a single variable could be
 used to keep track of how many "views" have been exported, or a
 linked-list of bufferinfo structures filled in could be maintained in
-each object.  
+each object.
 
 All that is specifically required by the exporter, however, is to
 ensure that any memory shared through the bufferinfo structure remains
@@ -405,8 +405,8 @@
 
 ::
 
-    int PyObject_GetBuffer(PyObject *obj, PyBuffer *view, 
-                           int flags)  
+    int PyObject_GetBuffer(PyObject *obj, PyBuffer *view,
+                           int flags)
 
 This is a C-API version of the getbuffer function call.  It checks to
 make sure object has the required function pointer and issues the
@@ -414,6 +414,7 @@
 success.
 
 ::
+
     int PyObject_ReleaseBuffer(PyObject *obj, PyBuffer *view)
 
 This is a C-API version of the releasebuffer function call.  It checks
@@ -435,7 +436,7 @@
 
   typedef struct {
       PyObject_HEAD
-      PyObject *base;      
+      PyObject *base;
       int ndims;
       Py_ssize_t *starts;  /* slice starts */
       Py_ssize_t *stops;   /* slice stops */
@@ -444,12 +445,12 @@
 
 This is functionally similar to the current buffer object except only
 a reference to base is kept.  The actual memory for base must be
-re-grabbed using the buffer-protocol, whenever it is needed. 
+re-grabbed using the buffer-protocol, whenever it is needed.
 
 The getbuffer and releasebuffer for this object use the underlying
 base object (adjusted using the slice information).  If the number of
 dimensions of the base object (or the strides or the size) has changed
-when a new view is requested, then the getbuffer will trigger an error. 
+when a new view is requested, then the getbuffer will trigger an error.
 
 This memory-view object will support mult-dimensional slicing.  Slices
 of the memory-view object are other memory-view objects. When an
@@ -478,9 +479,9 @@
 the fastest in the buffer.  If fortran is 'C', then the last dimension
 will vary the fastest (C-style contiguous). If fortran is 'A', then it
 does not matter and you will get whatever the object decides is more
-efficient.  
+efficient.
 
-:: 
+::
 
     int PyObject_CopyToObject(PyObject *obj, void *buf, Py_ssize_t len,
                               char fortran)
@@ -509,7 +510,7 @@
 These last three C-API calls allow a standard way of getting data in and
 out of Python objects into contiguous memory areas no matter how it is
 actually stored.  These calls use the extended buffer interface to perform
-their work. 
+their work.
 
 ::
 
@@ -521,7 +522,7 @@
 ::
 
     void PyBuffer_FillContiguousStrides(int *ndims, Py_ssize_t *shape,
-                                        int itemsize, 
+                                        int itemsize,
                                         Py_ssize_t *strides, char fortran)
 
 Fill the strides array with byte-strides of a contiguous (C-style if
@@ -529,13 +530,14 @@
 shape with the given number of bytes per element.
 
 ::
-    int PyBuffer_FillInfo(PyBuffer *view, void *buf, 
+
+    int PyBuffer_FillInfo(PyBuffer *view, void *buf,
                           Py_ssize_t len, int readonly, int infoflags)
 
 Fills in a buffer-info structure correctly for an exporter that can
 only share a contiguous chunk of memory of "unsigned bytes" of the
 given length.  Returns 0 on success and -1 (with raising an error) on
-error. 
+error.
 
 
 Additions to the struct string-syntax
@@ -543,7 +545,7 @@
 
 The struct string-syntax is missing some characters to fully
 implement data-format descriptions already available elsewhere (in
-ctypes and NumPy for example).  The Python 2.5 specification is 
+ctypes and NumPy for example).  The Python 2.5 specification is
 at http://docs.python.org/lib/module-struct.html
 
 Here are the proposed additions:
@@ -554,19 +556,19 @@
 ================  ===========
 't'               bit (number before states how many bits)
 '?'               platform _Bool type
-'g'               long double  
-'c'               ucs-1 (latin-1) encoding 
-'u'               ucs-2 
-'w'               ucs-4 
-'O'               pointer to Python Object 
+'g'               long double
+'c'               ucs-1 (latin-1) encoding
+'u'               ucs-2
+'w'               ucs-4
+'O'               pointer to Python Object
 'Z'               complex (whatever the next specifier is)
-'&'               specific pointer (prefix before another charater) 
-'T{}'             structure (detailed layout inside {}) 
-'(k1,k2,...,kn)'  multi-dimensional array of whatever follows 
-':name:'          optional name of the preceeding element 
-'X{}'             pointer to a function (optional function 
+'&'               specific pointer (prefix before another charater)
+'T{}'             structure (detailed layout inside {})
+'(k1,k2,...,kn)'  multi-dimensional array of whatever follows
+':name:'          optional name of the preceeding element
+'X{}'             pointer to a function (optional function
                                          signature inside {})
-' \n\t'           ignored (allow better readability) 
+' \n\t'           ignored (allow better readability)
                              -- this may already be true
 ================  ===========
 
@@ -588,7 +590,7 @@
 previously-specified endian string is in force until changed.  The
 default endian is '@' which means native data-types and alignment.  If
 un-aligned, native data-types are requested, then the endian
-specification is '^'.  
+specification is '^'.
 
 According to the struct-module, a number can preceed a character
 code to specify how many of that type there are.  The
@@ -603,7 +605,7 @@
 ====================================
 
 Here are some examples of C-structures and how they would be
-represented using the struct-style syntax. 
+represented using the struct-style syntax.
 
 <named> is the constructor for a named-tuple (not-specified yet).
 
@@ -614,7 +616,7 @@
 RGB Pixel data
     'BBB' <--> (int, int, int)
     'B:r: B:g: B:b:' <--> <named>((int, int, int), ('r','g','b'))
-    
+
 Mixed endian (weird but possible)
     '>i:big: <i:little:' <--> <named>((int, int), ('big', 'little'))
 
@@ -629,10 +631,10 @@
                  unsigned char cval;
              } sub;
         }
-        """i:ival: 
+        """i:ival:
            T{
-              H:sval: 
-              B:bval: 
+              H:sval:
+              B:bval:
               B:cval:
             }:sub:
         """
@@ -643,7 +645,7 @@
              int ival;
              double data[16*4];
         }
-        """i:ival: 
+        """i:ival:
            (16,4)d:data:
         """
 
@@ -662,7 +664,7 @@
 * mmap module
 * ctypes module
 
-Anything else using the buffer API.  
+Anything else using the buffer API.
 
 
 Issues and Details
@@ -692,9 +694,9 @@
 Memory management of the format string, the shape array, the strides
 array, and the suboffsets array in the bufferinfo structure is always
 the responsibility of the exporting object.  The consumer should not
-set these pointers to any other memory or try to free them. 
+set these pointers to any other memory or try to free them.
 
-Several ideas were discussed and rejected: 
+Several ideas were discussed and rejected:
 
     Having a "releaser" object whose release-buffer was called.  This
     was deemed unacceptable because it caused the protocol to be
@@ -706,7 +708,7 @@
     This had the advantage that it allowed one to set NULL to
     variables that were not of interest, but it also made the function
     call more difficult.  The flags variable allows the same
-    ability of consumers to be "simple" in how they call the protocol. 
+    ability of consumers to be "simple" in how they call the protocol.
 
 Code
 ========
@@ -723,7 +725,7 @@
 Ex. 1
 -----------
 
-This example shows how an image object that uses contiguous lines might expose its buffer.::
+This example shows how an image object that uses contiguous lines might expose its buffer.
 
 ::
 
@@ -749,8 +751,6 @@
 
 So what does ImageObject's getbuffer do?  Leaving error checking out::
 
-::
-
   int Image_getbuffer(PyObject *self, PyBuffer *view, int flags) {
 
       static Py_ssize_t suboffsets[2] = { -1, 0 };
@@ -762,7 +762,7 @@
       self->shape_array[0] = height;
       self->shape_array[1] = width;
       view->shape = &self->shape_array;
-      self->stride_array[0] = sizeof(struct rgba*);  
+      self->stride_array[0] = sizeof(struct rgba*);
       self->stride_array[1] = sizeof(struct rgba);
       view->strides = &self->stride_array;
       view->suboffsets = suboffsets;
@@ -770,7 +770,7 @@
       self->view_count ++;
 
       return 0;
-  } 
+  }
 
 
   int Image_releasebuffer(PyObject *self, PyBuffer *view) {
@@ -793,17 +793,16 @@
       void *buf;
       Py_ssize_t len;
       int readonly=0;
-        
+
       buf = /* Point to buffer */
       len = /* Set to size of buffer */
       readonly = /* Set to 1 if readonly */
-  
-      return PyObject_FillBufferInfo(view, buf, len, readonly, flags);    
+
+      return PyObject_FillBufferInfo(view, buf, len, readonly, flags);
   }
 
-/* No releasebuffer is necessary because the memory will never 
-be re-allocated so the locking mechanism is not needed
-*/
+No releasebuffer is necessary because the memory will never
+be re-allocated so the locking mechanism is not needed.
 
 Ex.  3
 -----------
@@ -815,7 +814,7 @@
 
   PyBuffer view;
   int ret;
-      
+
   if (PyObject_GetBuffer(obj, &view, Py_BUF_SIMPLE) < 0) {
        /* error return */
   }
@@ -824,15 +823,15 @@
           view.len is the length
           view.readonly is whether or not the memory is read-only.
    */
-  
 
+
   /* After using the information and you don't need it anymore */
-  
+
   if (PyObject_ReleaseBuffer(obj, &view) < 0) {
           /* error return */
   }
-  
 
+
 Ex. 4
 -----------
 
@@ -851,21 +850,20 @@
 
     /* process memory pointed to by buffer if format is correct */
 
-    /* Optional: 
-    
+    /* Optional:
+
        if, after processing, we want to copy data from buffer back
-       into the the object  
- 
+       into the the object
+
        we could do
        */
 
     if (PyObject_CopyToObject(obj, buf, len, 0) < 0) {
            /*        error return */
     }
-   
 
+
 Copyright
 =========
 
 This PEP is placed in the public domain
-

Modified: branches/numpy.scons/numpy/doc/records.txt
===================================================================
--- branches/numpy.scons/numpy/doc/records.txt	2007-11-13 13:10:59 UTC (rev 4450)
+++ branches/numpy.scons/numpy/doc/records.txt	2007-11-13 13:51:35 UTC (rev 4451)
@@ -1,86 +1,87 @@
 
-The ndarray supports records intrinsically.  
-None of the default descriptors have fields defined, but you can create new
-descriptors easily.  The ndarray even supports nested arrays of records inside 
-of a record.  Any record that the array protocol can describe can be represented. 
-The ndarray also supports partial field descriptors.  Not every byte has to be
-accounted for. 
+The ndarray supports records intrinsically.  None of the default
+descriptors have fields defined, but you can create new descriptors
+easily.  The ndarray even supports nested arrays of records inside of
+a record.  Any record that the array protocol can describe can be
+represented.  The ndarray also supports partial field descriptors.
+Not every byte has to be accounted for.
 
-This was done by adding to the established PyArray_Descr * structure:
+This was done by adding to the established ``PyArray_Descr *`` structure:
 
-1) a PyObject *fields member which contains a dictionary of 
-"field name" : (PyArray_Descr *field-type, offset, [optional field title]). 
-If a title is given, then it is also inserted into the dictionary and used to 
-key the same entry. 
+1. A PyObject ``*fields`` member which contains a dictionary of "field
+   name" : (``PyArray_Descr`` ``*field-type``, ``offset``, [optional field
+   title]).  If a title is given, then it is also inserted into the
+   dictionary and used to key the same entry.
 
-2) A byteorder member.  By default this is '=' (native), or '|' (not-applicable).
+2. A byteorder member.  By default this is '=' (native), or '|'
+   (not-applicable).
 
-3) An additional PyArray_ArrDescr *member of the structure which
-contains a simple representation of an array of another base-type.
-types. The PyArray_ArrayDescr structure has members PyArray_Descr *,
-PyObject *, for holding a reference to the base-type and the shape of
-the sub-array.
+3. An additional ``PyArray_ArrDescr`` ``*member`` of the structure which
+   contains a simple representation of an array of another base-type.
+   types. The ``PyArray_ArrayDescr`` structure has members
+   ``PyArray_Descr *``, ``PyObject *``, for holding a reference to
+   the base-type and the shape of the sub-array.
 
-4) The PyArray_Descr * as official Python object that fully describes
-a region of memory for the data
+4. The ``PyArray_Descr *`` as official Python object that fully describes
+   a region of memory for the data
 
- 
-Data type conversions: We can support additional data-type
-conversions.  The data-type passed in is converted to a PyArray_Descr*
-object.
 
+Data type conversions
+---------------------
+
+We can support additional data-type
+conversions.  The data-type passed in is converted to a
+``PyArray_Descr *`` object.
+
 New possibilities for the "data-type"
+`````````````````````````````````````
 
-List [data-type 1, data-type 2, ..., data-type n]
-===============================
-Equivalent to  {'names':['f1','f2',...,'fn'],
+**List [data-type 1, data-type 2, ..., data-type n]**
+  Equivalent to  {'names':['f1','f2',...,'fn'],
 	        'formats': [data-type 1, data-type 2, ..., data-type n]}
 
-This is a quick way to specify a record format with default field names.
+  This is a quick way to specify a record format with default field names.
 
 
-Tuple  (flexible type, itemsize)
-       (fixed type, shape)
-===============================
+**Tuple  (flexible type, itemsize) (fixed type, shape)**
+  Get converted to a new ``PyArray_Descr *`` object with a flexible
+  type. The latter structure also sets the ``PyArray_ArrayDescr`` field of the
+  returned ``PyArray_Descr *``.
 
-Get converted to a new PyArray_Descr * object with a flexible
-type. The latter structure also sets the PyArray_ArrayDescr field of the
-returned PyArray_Descr *.
 
+**Dictionary (keys "names", "titles", and "formats")**
+  This will be converted to a ``PyArray_VOID`` type with corresponding
+  fields parameter (the formats list will be converted to actual
+  ``PyArray_Descr *`` objects).
 
-Dictionary (keys "names", "titles", and "formats")
-===============================
 
-This will be converted to a PyArray_VOID type with corresponding
-fields parameter (the formats list will be converted to actual
-PyArray_Descr * objects).
+**Objects (anything with an .itemsize and .fields attribute)**
+  If its an instance of (a sub-class of) void type, then a new
+  ``PyArray_Descr*`` structure is created corresponding to its
+  typeobject (and ``PyArray_VOID``) typenumber.  If the type is
+  registered, then the registered type-number is used.
 
+  Otherwise a new ``PyArray_VOID PyArray_Descr*`` structure is created
+  and filled ->elsize and ->fields filled in appropriately.
 
-Objects (anything with an .itemsize and .fields attribute)
-=============================== 
+  The itemsize attribute must return a number > 0. The fields
+  attribute must return a dictionary with at least "names" and
+  "formats" entries.  The "formats" entry will be converted to a
+  "proper" descr->fields entry (all generic data-types converted to
+  ``PyArray_Descr *`` structure).
 
-If its an instance of (a sub-class of) void type, then a new
-PyArray_Descr* structure is created corresponding to its typeobject 
-(and PyArray_VOID) typenumber.  If the type is registered, then the
-registered type-number is used. 
 
-otherwise a new PyArray_VOID PyArray_Descr* structure is created and
-filled ->elsize and ->fields filled in appropriately.
+Reference counting for ``PyArray_Descr *`` objects.
+```````````````````````````````````````````````````
 
-The itemsize attribute must return a number > 0
-The fields attribute must return a dictionary with at least 
-"names" and "formats" entries.  The "formats" entry will be 
-converted to a "proper" descr->fields entry (all generic data-types
-converted to PyArray_Descr * structure). 
+Most functions that take ``PyArary_Descr *`` as arguments and return a
+``PyObject *`` steal the reference unless otherwise noted in the code:
 
+Functions that return ``PyArray_Descr *`` objects return a new
+reference.
 
-Reference counting for PyArray_Descr * objects.
+.. tip::
 
-Most functions that take PyArary_Descr * as arguments and return a PyObject *
-steal the reference unless otherwise noted in the code: 
+  There is a new function  and a new method of array objects both labelled
+  dtypescr which can be used to try out the ``PyArray_DescrConverter``.
 
-Functions that return PyArray_Descr * objects return a new reference. 
-
-There is a new function  and a new method of array objects both labelled
-dtypescr which can be used to try out the PyArray_DescrConverter.
-

Modified: branches/numpy.scons/numpy/doc/ufuncs.txt
===================================================================
--- branches/numpy.scons/numpy/doc/ufuncs.txt	2007-11-13 13:10:59 UTC (rev 4450)
+++ branches/numpy.scons/numpy/doc/ufuncs.txt	2007-11-13 13:51:35 UTC (rev 4451)
@@ -1,18 +1,20 @@
+BUFFERED General Ufunc explanation
+==================================
 
-BUFFERED General Ufunc explanation:
+.. note::
 
-Note:  This was implemented already, but the notes are kept here for historical 
-       and explanatory purposes.
+  This was implemented already, but the notes are kept here for historical
+  and explanatory purposes.
 
 We need to optimize the section of ufunc code that handles mixed-type
 and misbehaved arrays.  In particular, we need to fix it so that items
-are not copied into the buffer if they don't have to be. 
+are not copied into the buffer if they don't have to be.
 
 Right now, all data is copied into the buffers (even scalars are copied
-multiple times into the buffers even if they are not going to be cast). 
+multiple times into the buffers even if they are not going to be cast).
 
-Some benchmarks show that this results in a significant slow-down 
-(factor of 4) over similar numarray code. 
+Some benchmarks show that this results in a significant slow-down
+(factor of 4) over similar numarray code.
 
 The approach is therefore, to loop over the largest-dimension (just like
 the NO_BUFFER) portion of the code.  All arrays will either have N or
@@ -31,31 +33,31 @@
 If N > B, then we have to do the above operation in a loop (with an extra loop
 at the end with a different buffer size).
 
-Both of these cases are handled with the following code:
+Both of these cases are handled with the following code::
 
-Compute N = quotient * B + remainder.   
-   quotient = N / B  # integer math    
-         (store quotient + 1) as the number of innerloops
+   Compute N = quotient * B + remainder.
+   quotient = N / B  # integer math
+   (store quotient + 1) as the number of innerloops
    remainder = N % B # integer remainder
 
-On the inner-dimension we will have (quotient + 1) loops where 
+On the inner-dimension we will have (quotient + 1) loops where
 the size of the inner function is B for all but the last when the niter size is
-remainder. 
+remainder.
 
-So, the code looks very similar to NOBUFFER_LOOP except the inner loop is 
-replaced with...
+So, the code looks very similar to NOBUFFER_LOOP except the inner loop is
+replaced with::
 
-for(k=0; i<quotient+1; k++) {
-	 if (k==quotient+1) make itersize remainder size
-	 copy only needed items to buffer.
-	 swap input buffers if needed
-	 cast input buffers if needed
-	 call function()
-	 cast outputs in buffers if needed
-	 swap outputs in buffers if needed
- 	 copy only needed items back to output arrays.	 
-	 update all data-pointers by strides*niter
-}
+  for(k=0; i<quotient+1; k++) {
+      if (k==quotient+1) make itersize remainder size
+      copy only needed items to buffer.
+      swap input buffers if needed
+      cast input buffers if needed
+      call function()
+      cast outputs in buffers if needed
+      swap outputs in buffers if needed
+      copy only needed items back to output arrays.
+      update all data-pointers by strides*niter
+  }
 
 
 Reference counting for OBJECT arrays:
@@ -63,19 +65,19 @@
 If there are object arrays involved then loop->obj gets set to 1.  Then there are two cases:
 
 1) The loop function is an object loop:
-  
-   Inputs:  
+
+   Inputs:
 	    - castbuf starts as NULL and then gets filled with new references.
 	    - function gets called and doesn't alter the reference count in castbuf
 	    - on the next iteration (next value of k), the casting function will
 	      DECREF what is present in castbuf already and place a new object.
-	     
+
 	    - At the end of the inner loop (for loop over k), the final new-references
 	      in castbuf must be DECREF'd.  If its a scalar then a single DECREF suffices
-	      Otherwise, "bufsize" DECREF's are needed (unless there was only one 
+	      Otherwise, "bufsize" DECREF's are needed (unless there was only one
 	      loop, then "remainder" DECREF's are needed).
 
-   Outputs: 
+   Outputs:
             - castbuf contains a new reference as the result of the function call.  This
 	      gets converted to the type of interest and.  This new reference in castbuf
 	      will be DECREF'd by later calls to the function.  Thus, only after the
@@ -89,13 +91,13 @@
 	      reference.  This reference is then used but not altered by the cast
 	      call.   Nothing needs to be done.
 
-   Outputs: 
-   
-            - The buffer[i] memory receives the PyObject input after the cast.  This is 
-	      a new reference which will be "stolen" as it is copied over into memory. 
+   Outputs:
+
+            - The buffer[i] memory receives the PyObject input after the cast.  This is
+	      a new reference which will be "stolen" as it is copied over into memory.
 	      The only problem is that what is presently in memory must be DECREF'd first.
 
 
 
-	 
-	      
+
+

Modified: branches/numpy.scons/numpy/f2py/auxfuncs.py
===================================================================
--- branches/numpy.scons/numpy/f2py/auxfuncs.py	2007-11-13 13:10:59 UTC (rev 4450)
+++ branches/numpy.scons/numpy/f2py/auxfuncs.py	2007-11-13 13:51:35 UTC (rev 4451)
@@ -19,7 +19,10 @@
 f2py_version = __version__.version
 
 import pprint
-import sys,string,time,types,os
+import sys
+import time
+import types
+import os
 import cfuncs
 
 
@@ -254,13 +257,13 @@
     for i in range(len(f)):
         l='%s,f%d=f[%d]'%(l,i,i)
         l2.append('f%d(v)'%(i))
-    return eval('%s:%s'%(l,string.join(l2,' and ')))
+    return eval('%s:%s'%(l,' and '.join(l2)))
 def l_or(*f):
     l,l2='lambda v',[]
     for i in range(len(f)):
         l='%s,f%d=f[%d]'%(l,i,i)
         l2.append('f%d(v)'%(i))
-    return eval('%s:%s'%(l,string.join(l2,' or ')))
+    return eval('%s:%s'%(l,' or '.join(l2)))
 def l_not(f):
     return eval('lambda v,f=f:not f(v)')
 
@@ -340,7 +343,7 @@
                 arg_types2.append('size_t')
         arg_types.append(ctype)
 
-    proto_args = string.join(arg_types+arg_types2,',')
+    proto_args = ','.join(arg_types+arg_types2)
     if not proto_args:
         proto_args = 'void'
     #print proto_args
@@ -411,9 +414,9 @@
         else:
             sep=defaultsep
         if type(dict[k])==types.ListType:
-            str=string.replace(str,'#%s#'%(k),string.join(flatlist(dict[k]),sep))
+            str=str.replace('#%s#'%(k),sep.join(flatlist(dict[k])))
         else:
-            str=string.replace(str,'#%s#'%(k),dict[k])
+            str=str.replace('#%s#'%(k),dict[k])
     return str
 
 def dictappend(rd,ar):

Modified: branches/numpy.scons/numpy/f2py/capi_maps.py
===================================================================
--- branches/numpy.scons/numpy/f2py/capi_maps.py	2007-11-13 13:10:59 UTC (rev 4450)
+++ branches/numpy.scons/numpy/f2py/capi_maps.py	2007-11-13 13:51:35 UTC (rev 4451)
@@ -16,7 +16,9 @@
 import __version__
 f2py_version = __version__.version
 
-import string,copy,re,os
+import copy
+import re
+import os
 from auxfuncs import *
 from crackfortran import markoutercomma
 import cb_rules
@@ -170,8 +172,8 @@
         f.close()
         for k,d1 in d.items():
             for k1 in d1.keys():
-                d1[string.lower(k1)] = d1[k1]
-            d[string.lower(k)] = d[k]
+                d1[k1.lower()] = d1[k1]
+            d[k.lower()] = d[k]
         for k in d.keys():
             if not f2cmap_all.has_key(k): f2cmap_all[k]={}
             for k1 in d[k].keys():
@@ -217,8 +219,8 @@
         else: errmess('getctype: function %s has no return value?!\n'%a)
     elif issubroutine(var):
         return ctype
-    elif var.has_key('typespec') and f2cmap_all.has_key(string.lower(var['typespec'])):
-        typespec = string.lower(var['typespec'])
+    elif var.has_key('typespec') and f2cmap_all.has_key(var['typespec'].lower()):
+        typespec = var['typespec'].lower()
         f2cmap=f2cmap_all[typespec]
         ctype=f2cmap[''] # default type
         if var.has_key('kindselector'):
@@ -279,10 +281,10 @@
 #         if not isintent_c(var):
 #             var['dimension'].reverse()
         dim=copy.copy(var['dimension'])
-        ret['size']=string.join(dim,'*')
+        ret['size']='*'.join(dim)
         try: ret['size']=`eval(ret['size'])`
         except: pass
-        ret['dims']=string.join(dim,',')
+        ret['dims']=','.join(dim)
         ret['rank']=`len(dim)`
         ret['rank*[-1]']=`len(dim)*[-1]`[1:-1]
         for i in range(len(dim)): # solve dim for dependecies
@@ -359,13 +361,13 @@
         rank=`len(dim)`
         sig='%s :%s %s rank-%s array(\'%s\') with bounds (%s)'%(a,init,opt,rank,
                                              c2pycode_map[ctype],
-                                             string.join(dim,','))
+                                             ','.join(dim))
         if a==out_a:
             sigout='%s : rank-%s array(\'%s\') with bounds (%s)'\
-                    %(a,rank,c2pycode_map[ctype],string.join(dim,','))
+                    %(a,rank,c2pycode_map[ctype],','.join(dim))
         else:
             sigout='%s : rank-%s array(\'%s\') with bounds (%s) and %s storage'\
-                    %(out_a,rank,c2pycode_map[ctype],string.join(dim,','),a)
+                    %(out_a,rank,c2pycode_map[ctype],','.join(dim),a)
     elif isexternal(var):
         ua=''
         if lcb_map.has_key(a) and lcb2_map.has_key(lcb_map[a]) and lcb2_map[lcb_map[a]].has_key('argname'):
@@ -389,7 +391,7 @@
         rank=`len(dim)`
         sig='%s : rank-%s array(\'%s\') with bounds (%s)'%(a,rank,
                                                            c2pycode_map[ctype],
-                                                           string.join(dim,','))
+                                                           ','.join(dim))
     return sig
 
 def getinit(a,var):
@@ -404,7 +406,7 @@
             try:
                 v = var["="]
                 if ',' in v:
-                    ret['init.r'],ret['init.i']=string.split(markoutercomma(v[1:-1]),'@,@')
+                    ret['init.r'],ret['init.i']=markoutercomma(v[1:-1]).split('@,@')
                 else:
                     v = eval(v,{},{})
                     ret['init.r'],ret['init.i']=str(v.real),str(v.imag)
@@ -414,7 +416,7 @@
         elif isstring(var):
             if not init: init,showinit='""',"''"
             if init[0]=="'":
-                init='"%s"'%(string.replace(init[1:-1],'"','\\"'))
+                init='"%s"'%(init[1:-1].replace('"','\\"'))
             if init[0]=='"': showinit="'%s'"%(init[1:-1])
     return init,showinit
 
@@ -440,7 +442,7 @@
         if f(var): intent_flags.append('F2PY_%s'%s)
     if intent_flags:
         #XXX: Evaluate intent_flags here.
-        ret['intent'] = string.join(intent_flags,'|')
+        ret['intent'] = '|'.join(intent_flags)
     else:
         ret['intent'] = 'F2PY_INTENT_IN'
     if isarray(var): ret['varrformat']='N'
@@ -449,7 +451,7 @@
     else: ret['varrformat']='O'
     ret['init'],ret['showinit']=getinit(a,var)
     if hasinitvalue(var) and iscomplex(var) and not isarray(var):
-        ret['init.r'],ret['init.i'] = string.split(markoutercomma(ret['init'][1:-1]),'@,@')
+        ret['init.r'],ret['init.i'] = markoutercomma(ret['init'][1:-1]).split('@,@')
     if isexternal(var):
         ret['cbnamekey']=a
         if lcb_map.has_key(a):
@@ -491,14 +493,14 @@
         if isarray(var):
 #             if not isintent_c(var):
 #                 var['dimension'].reverse()
-            ddim=string.join(map(lambda x,y:'%s|%s'%(x,y),var['dimension'],dim),',')
+            ddim=','.join(map(lambda x,y:'%s|%s'%(x,y),var['dimension'],dim))
             rl.append('dims(%s)'%ddim)
 #             if not isintent_c(var):
 #                 var['dimension'].reverse()
         if isexternal(var):
-            ret['vardebuginfo']='debug-capi:%s=>%s:%s'%(a,ret['cbname'],string.join(rl,','))
+            ret['vardebuginfo']='debug-capi:%s=>%s:%s'%(a,ret['cbname'],','.join(rl))
         else:
-            ret['vardebuginfo']='debug-capi:%s %s=%s:%s'%(ret['ctype'],a,ret['showinit'],string.join(rl,','))
+            ret['vardebuginfo']='debug-capi:%s %s=%s:%s'%(ret['ctype'],a,ret['showinit'],','.join(rl))
         if isscalar(var):
             if cformat_map.has_key(ret['ctype']):
                 ret['vardebugshowvalue']='debug-capi:%s=%s'%(a,cformat_map[ret['ctype']])
@@ -526,13 +528,13 @@
     name = rout['name']
     fname = getfortranname(rout)
     ret={'name':name,
-         'texname':string.replace(name,'_','\\_'),
-         'name_lower':string.lower(name),
-         'NAME':string.upper(name),
+         'texname':name.replace('_','\\_'),
+         'name_lower':name.lower(),
+         'NAME':name.upper(),
          'begintitle':gentitle(name),
          'endtitle':gentitle('end of %s'%name),
          'fortranname':fname,
-         'FORTRANNAME':string.upper(fname),
+         'FORTRANNAME':fname.upper(),
          'callstatement':getcallstatement(rout) or '',
          'usercode':getusercode(rout) or '',
          'usercode1':getusercode1(rout) or '',
@@ -595,12 +597,12 @@
     """
     if ismodule(m):
         ret={'f90modulename':m['name'],
-             'F90MODULENAME':string.upper(m['name']),
-             'texf90modulename':string.replace(m['name'],'_','\\_')}
+             'F90MODULENAME':m['name'].upper(),
+             'texf90modulename':m['name'].replace('_','\\_')}
     else:
         ret={'modulename':m['name'],
-             'MODULENAME':string.upper(m['name']),
-             'texmodulename':string.replace(m['name'],'_','\\_')}
+             'MODULENAME':m['name'].upper(),
+             'texmodulename':m['name'].replace('_','\\_')}
     ret['restdoc'] = getrestdoc(m) or []
     if hasnote(m):
         ret['note']=m['note']

Modified: branches/numpy.scons/numpy/f2py/cb_rules.py
===================================================================
--- branches/numpy.scons/numpy/f2py/cb_rules.py	2007-11-13 13:10:59 UTC (rev 4450)
+++ branches/numpy.scons/numpy/f2py/cb_rules.py	2007-11-13 13:51:35 UTC (rev 4451)
@@ -20,7 +20,10 @@
 
 
 import pprint
-import sys,string,time,types,copy
+import sys
+import time
+import types
+import copy
 errmess=sys.stderr.write
 outmess=sys.stdout.write
 show=pprint.pprint
@@ -290,7 +293,7 @@
     },
     'strarglens':{isstring:',int #varname#_cb_len'}, # untested with multiple args
     'strarglens_td':{isstring:',int'}, # untested with multiple args
-    'strarglens_nm':{isstring:',#varname#_cb_len'}, # untested with multiple args 
+    'strarglens_nm':{isstring:',#varname#_cb_len'}, # untested with multiple args
      },
     { # Scalars
     'decl':{l_not(isintent_c):'\t#ctype# #varname#=(*#varname#_cb_capi);'},
@@ -484,8 +487,8 @@
                                    {'docsign':rd['docsign'],
                                     'docsignopt':optargs,
                                     })
-    rd['latexdocsignature']=string.replace(rd['docsignature'],'_','\\_')
-    rd['latexdocsignature']=string.replace(rd['latexdocsignature'],',',', ')
+    rd['latexdocsignature']=rd['docsignature'].replace('_','\\_')
+    rd['latexdocsignature']=rd['latexdocsignature'].replace(',',', ')
     rd['docstrsigns']=[]
     rd['latexdocstrsigns']=[]
     for k in ['docstrreq','docstropt','docstrout','docstrcbs']:

Modified: branches/numpy.scons/numpy/f2py/common_rules.py
===================================================================
--- branches/numpy.scons/numpy/f2py/common_rules.py	2007-11-13 13:10:59 UTC (rev 4450)
+++ branches/numpy.scons/numpy/f2py/common_rules.py	2007-11-13 13:51:35 UTC (rev 4451)
@@ -19,7 +19,10 @@
 f2py_version = __version__.version
 
 import pprint
-import sys,string,time,types,copy
+import sys
+import time
+import types
+import copy
 errmess=sys.stderr.write
 outmess=sys.stdout.write
 show=pprint.pprint
@@ -63,24 +66,24 @@
     doc = ['']
     def dadd(line,s=doc): s[0] = '%s\n%s'%(s[0],line)
     for (name,vnames,vars) in findcommonblocks(m):
-        lower_name = string.lower(name)
+        lower_name = name.lower()
         hnames,inames = [],[]
         for n in vnames:
             if isintent_hide(vars[n]): hnames.append(n)
             else: inames.append(n)
         if hnames:
-            outmess('\t\tConstructing COMMON block support for "%s"...\n\t\t  %s\n\t\t  Hidden: %s\n'%(name,string.join(inames,','),string.join(hnames,',')))
+            outmess('\t\tConstructing COMMON block support for "%s"...\n\t\t  %s\n\t\t  Hidden: %s\n'%(name,','.join(inames),','.join(hnames)))
         else:
-            outmess('\t\tConstructing COMMON block support for "%s"...\n\t\t  %s\n'%(name,string.join(inames,',')))
+            outmess('\t\tConstructing COMMON block support for "%s"...\n\t\t  %s\n'%(name,','.join(inames)))
         fadd('subroutine f2pyinit%s(setupfunc)'%name)
         fadd('external setupfunc')
         for n in vnames:
             fadd(func2subr.var2fixfortran(vars,n))
         if name=='_BLNK_':
-            fadd('common %s'%(string.join(vnames,',')))
+            fadd('common %s'%(','.join(vnames)))
         else:
-            fadd('common /%s/ %s'%(name,string.join(vnames,',')))
-        fadd('call setupfunc(%s)'%(string.join(inames,',')))
+            fadd('common /%s/ %s'%(name,','.join(vnames)))
+        fadd('call setupfunc(%s)'%(','.join(inames)))
         fadd('end\n')
         cadd('static FortranDataDef f2py_%s_def[] = {'%(name))
         idims=[]
@@ -90,12 +93,12 @@
             dm = capi_maps.getarrdims(n,vars[n])
             if dm['dims']: idims.append('(%s)'%(dm['dims']))
             else: idims.append('')
-            dms=string.strip(dm['dims'])
+            dms=dm['dims'].strip()
             if not dms: dms='-1'
             cadd('\t{\"%s\",%s,{{%s}},%s},'%(n,dm['rank'],dms,at))
         cadd('\t{NULL}\n};')
         inames1 = rmbadname(inames)
-        inames1_tps = string.join(map(lambda s:'char *'+s,inames1),',')
+        inames1_tps = ','.join(map(lambda s:'char *'+s,inames1))
         cadd('static void f2py_setup_%s(%s) {'%(name,inames1_tps))
         cadd('\tint i_f2py=0;')
         for n in inames1:
@@ -106,24 +109,24 @@
         else:
             F_FUNC='F_FUNC'
         cadd('extern void %s(f2pyinit%s,F2PYINIT%s)(void(*)(%s));'\
-             %(F_FUNC,lower_name,string.upper(name),
-               string.join(['char*']*len(inames1),',')))
+             %(F_FUNC,lower_name,name.upper(),
+               ','.join(['char*']*len(inames1))))
         cadd('static void f2py_init_%s(void) {'%name)
         cadd('\t%s(f2pyinit%s,F2PYINIT%s)(f2py_setup_%s);'\
-             %(F_FUNC,lower_name,string.upper(name),name))
+             %(F_FUNC,lower_name,name.upper(),name))
         cadd('}\n')
         iadd('\tF2PyDict_SetItemString(d, \"%s\", PyFortranObject_New(f2py_%s_def,f2py_init_%s));'%(name,name,name))
-        tname = string.replace(name,'_','\\_')
+        tname = name.replace('_','\\_')
         dadd('\\subsection{Common block \\texttt{%s}}\n'%(tname))
         dadd('\\begin{description}')
         for n in inames:
             dadd('\\item[]{{}\\verb@%s@{}}'%(capi_maps.getarrdocsign(n,vars[n])))
             if hasnote(vars[n]):
                 note = vars[n]['note']
-                if type(note) is type([]): note=string.join(note,'\n')
+                if type(note) is type([]): note='\n'.join(note)
                 dadd('--- %s'%(note))
         dadd('\\end{description}')
-        ret['docs'].append('"\t/%s/ %s\\n"'%(name,string.join(map(lambda v,d:v+d,inames,idims),',')))
+        ret['docs'].append('"\t/%s/ %s\\n"'%(name,','.join(map(lambda v,d:v+d,inames,idims))))
     ret['commonhooks']=chooks
     ret['initcommonhooks']=ihooks
     ret['latexdoc']=doc[0]

Modified: branches/numpy.scons/numpy/f2py/crackfortran.py
===================================================================
--- branches/numpy.scons/numpy/f2py/crackfortran.py	2007-11-13 13:10:59 UTC (rev 4450)
+++ branches/numpy.scons/numpy/f2py/crackfortran.py	2007-11-13 13:51:35 UTC (rev 4451)
@@ -15,6 +15,7 @@
 __version__ = "$Revision: 1.177 $"[10:-1]
 
 import __version__
+import string
 f2py_version = __version__.version
 
 """
@@ -143,7 +144,13 @@
      The above may be solved by creating appropriate preprocessor program, for example.
 """
 #
-import sys,string,fileinput,re,pprint,os,copy
+import sys
+import string
+import fileinput
+import re
+import pprint
+import os
+import copy
 from auxfuncs import *
 
 # Global flags:
@@ -222,7 +229,7 @@
 def undo_rmbadname(names): return map(undo_rmbadname1,names)
 
 def getextension(name):
-    i=string.rfind(name,'.')
+    i=name.rfind('.')
     if i==-1: return ''
     if '\\' in name[i:]: return ''
     if '/' in name[i:]: return ''
@@ -307,7 +314,7 @@
                     %(`currentfilename`,sourcecodeform,
                       strictf77 and ',strict' or ''))
 
-        l=string.expandtabs(l).replace('\xa0',' ')
+        l=l.expandtabs().replace('\xa0',' ')
         while not l=='':                       # Get rid of newline characters
             if l[-1] not in "\n\r\f": break
             l=l[:-1]
@@ -316,17 +323,17 @@
             if r:
                 l=r.group('line')+' ' # Strip comments starting with `!'
                 rl=r.group('rest')
-                if string.lower(rl[:4])=='f2py': # f2py directive
+                if rl[:4].lower()=='f2py': # f2py directive
                     l = l + 4*' '
                     r=commentline.match(rl[4:])
                     if r: l=l+r('line')
                     else: l = l + rl[4:]
-        if string.strip(l)=='': # Skip empty line
+        if l.strip()=='': # Skip empty line
             cont=0
             continue
         if sourcecodeform=='fix':
             if l[0] in ['*','c','!','C','#']:
-                if string.lower(l[1:5])=='f2py': # f2py directive
+                if l[1:5].lower()=='f2py': # f2py directive
                     l='     '+l[5:]
                 else: # Skip comment line
                     cont=0
@@ -352,14 +359,14 @@
                         origfinalline=''
                     else:
                         l='     '+l[5:] # clean up line beginning from possible digits.
-                        if localdolowercase: finalline=string.lower(ll)
+                        if localdolowercase: finalline=ll.lower()
                         else: finalline=ll
                         origfinalline=ll
                         ll=l
                     cont=(r is not None)
                 else:
                     l='     '+l[5:] # clean up line beginning from possible digits.
-                    if localdolowercase: finalline=string.lower(ll)
+                    if localdolowercase: finalline=ll.lower()
                     else: finalline=ll
                     origfinalline =ll
                     ll=l
@@ -383,7 +390,7 @@
                 finalline=''
                 origfinalline=''
             else:
-                if localdolowercase: finalline=string.lower(ll)
+                if localdolowercase: finalline=ll.lower()
                 else: finalline=ll
                 origfinalline =ll
                 ll=l
@@ -411,7 +418,7 @@
             dowithline(finalline)
         l1=ll
     if localdolowercase:
-        finalline=string.lower(ll)
+        finalline=ll.lower()
     else: finalline=ll
     origfinalline = ll
     filepositiontext='Line #%d in %s:"%s"\n\t' % (fin.filelineno()-1,currentfilename,l1)
@@ -482,11 +489,11 @@
 
 def _simplifyargs(argsline):
     a = []
-    for n in string.split(markoutercomma(argsline),'@,@'):
+    for n in markoutercomma(argsline).split('@,@'):
         for r in '(),':
-            n = string.replace(n,r,'_')
+            n = n.replace(r,'_')
         a.append(n)
-    return string.join(a,',')
+    return ','.join(a)
 
 crackline_re_1 = re.compile(r'\s*(?P<result>\b[a-z]+[\w]*\b)\s*[=].*',re.I)
 def crackline(line,reset=0):
@@ -650,7 +657,7 @@
     assert not f,`f,line,l,cc`
     return l
 def unmarkouterparen(line):
-    r = string.replace(string.replace(line,'@(@','('),'@)@',')')
+    r = line.replace('@(@','(').replace('@)@',')')
     return r
 def appenddecl(decl,decl2,force=1):
     if not decl: decl={}
@@ -706,7 +713,7 @@
         previous_context = None
     if expectbegin and case not in ['begin','call','callfun','type'] \
        and not skipemptyends and groupcounter<1:
-        newname=string.split(os.path.basename(currentfilename),'.')[0]
+        newname=os.path.basename(currentfilename).split('.')[0]
         outmess('analyzeline: no group yet. Creating program group with name "%s".\n'%newname)
         gotnextfile=0
         groupcounter=groupcounter+1
@@ -734,7 +741,7 @@
                 outmess('analyzeline: No name/args pattern found for line.\n')
 
         previous_context = (block,name,groupcounter)
-        if args: args=rmbadname(map(string.strip,string.split(markoutercomma(args),'@,@')))
+        if args: args=rmbadname([x.strip() for x in markoutercomma(args).split('@,@')])
         else: args=[]
         if '' in args:
             while '' in args:
@@ -851,7 +858,7 @@
         name,args,result=_resolvenameargspattern(m.group('after'))
         if name is not None:
             if args:
-                args=rmbadname(map(string.strip,string.split(markoutercomma(args),'@,@')))
+                args=rmbadname([x.strip() for x in markoutercomma(args).strip('@,@')])
             else: args=[]
             assert result is None,`result`
             groupcache[groupcounter]['entry'][name] = args
@@ -864,22 +871,22 @@
     elif case in ['dimension','intent','optional','required','external','public','private','intrisic']:
         edecl=groupcache[groupcounter]['vars']
         ll=m.group('after').strip()
-        i=string.find(ll,'::')
+        i=ll.find('::')
         if i<0 and case=='intent':
-            i=string.find(markouterparen(ll),'@)@')-2
+            i=markouterparen(ll).find('@)@')-2
             ll=ll[:i+1]+'::'+ll[i+1:]
-            i=string.find(ll,'::')
+            i=ll.find('::')
             if ll[i:]=='::' and groupcache[groupcounter].has_key('args'):
                 outmess('All arguments will have attribute %s%s\n'%(m.group('this'),ll[:i]))
-                ll = ll + string.join(groupcache[groupcounter]['args'],',')
+                ll = ll + ','.join(groupcache[groupcounter]['args'])
         if i<0:i=0;pl=''
-        else: pl=string.strip(ll[:i]);ll=ll[i+2:]
-        ch = string.split(markoutercomma(pl),'@,@')
+        else: pl=ll[:i].strip();ll=ll[i+2:]
+        ch = markoutercomma(pl).split('@,@')
         if len(ch)>1:
             pl = ch[0]
             outmess('analyzeline: cannot handle multiple attributes without type specification. Ignoring %r.\n' % (','.join(ch[1:])))
         last_name = None
-        for e in map(string.strip,string.split(markoutercomma(ll),'@,@')):
+        for e in [x.strip() for x in markoutercomma(ll).split('@,@')]:
             m1=namepattern.match(e)
             if not m1:
                 if case in ['public','private']: k=''
@@ -896,8 +903,7 @@
                 if _intentcallbackpattern.match(ap):
                     if k not in groupcache[groupcounter]['args']:
                         if groupcounter>1 and \
-                               string.find(groupcache[groupcounter-2]['name'],
-                                           '__user__')==-1:
+                               '__user__' in groupcache[groupcounter-2]['name']:
                             outmess('analyzeline: appending intent(callback) %s'\
                                     ' to %s arguments\n' % (k,groupcache[groupcounter]['name']))
                             groupcache[groupcounter]['args'].append(k)
@@ -923,11 +929,11 @@
             previous_context = ('variable',last_name,groupcounter)
     elif case=='parameter':
         edecl=groupcache[groupcounter]['vars']
-        ll=string.strip(m.group('after'))[1:-1]
+        ll=m.group('after').strip()[1:-1]
         last_name = None
-        for e in string.split(markoutercomma(ll),'@,@'):
+        for e in markoutercomma(ll).split('@,@'):
             try:
-                k,initexpr=map(string.strip,string.split(e,'='))
+                k,initexpr=[x.strip() for x in e.split('=')]
             except:
                 outmess('analyzeline: could not extract name,expr in parameter statement "%s" of "%s"\n'%(e,ll));continue
             params = get_parameters(edecl)
@@ -942,7 +948,7 @@
                     for m in real16pattern.finditer(initexpr):
                         tt[m.start():m.end()] = list(\
                             initexpr[m.start():m.end()].lower().replace('d', 'e'))
-                    initexpr = "".join(tt)
+                    initexpr = ''.join(tt)
                 elif t.get('typespec')=='complex':
                     initexpr = initexpr[1:].lower().replace('d','e').\
                                replace(',','+1j*(')
@@ -961,7 +967,7 @@
         if last_name is not None:
             previous_context = ('variable',last_name,groupcounter)
     elif case=='implicit':
-        if string.lower(string.strip(m.group('after')))=='none':
+        if m.group('after').strip().lower()=='none':
             groupcache[groupcounter]['implicit']=None
         elif m.group('after'):
             if groupcache[groupcounter].has_key('implicit'):
@@ -970,7 +976,7 @@
             if impl is None:
                 outmess('analyzeline: Overwriting earlier "implicit none" statement.\n')
                 impl={}
-            for e in string.split(markoutercomma(m.group('after')),'@,@'):
+            for e in markoutercomma(m.group('after')).split('@,@'):
                 decl={}
                 m1=re.match(r'\s*(?P<this>.*?)\s*(\(\s*(?P<after>[a-z-, ]+)\s*\)\s*|)\Z',e,re.I)
                 if not m1:
@@ -986,12 +992,12 @@
                 decl['typename']=typename
                 for k in decl.keys():
                     if not decl[k]: del decl[k]
-                for r in string.split(markoutercomma(m1.group('after')),'@,@'):
+                for r in markoutercomma(m1.group('after')).split('@,@'):
                     if '-' in r:
-                        try: begc,endc=map(string.strip,string.split(r,'-'))
+                        try: begc,endc=[x.strip() for x in r.split('-')]
                         except:
                             outmess('analyzeline: expected "<char>-<char>" instead of "%s" in range list of implicit statement\n'%r);continue
-                    else: begc=endc=string.strip(r)
+                    else: begc=endc=r.strip()
                     if not len(begc)==len(endc)==1:
                         outmess('analyzeline: expected "<char>-<char>" instead of "%s" in range list of implicit statement (2)\n'%r);continue
                     for o in range(ord(begc),ord(endc)+1):
@@ -1024,7 +1030,7 @@
             vars=groupcache[groupcounter]['vars']
         last_name = None
         for l in ll:
-            l=map(string.strip,l)
+            l=[x.strip() for x in l]
             if l[0][0]==',':l[0]=l[0][1:]
             if l[0][0]=='(':
                 outmess('analyzeline: implied-DO list "%s" is not supported. Skipping.\n'%l[0])
@@ -1033,7 +1039,7 @@
             #    #outmess('analyzeline: ignoring this data statement.\n')
             #    continue
             i=0;j=0;llen=len(l[1])
-            for v in rmbadname(map(string.strip,string.split(markoutercomma(l[0]),'@,@'))):
+            for v in rmbadname([x.strip() for x in markoutercomma(l[0]).split('@,@')]):
                 if v[0]=='(':
                     outmess('analyzeline: implied-DO list "%s" is not supported. Skipping.\n'%v)
                     # XXX: subsequent init expressions may get wrong values.
@@ -1056,20 +1062,20 @@
         if last_name is not None:
             previous_context = ('variable',last_name,groupcounter)
     elif case=='common':
-        line=string.strip(m.group('after'))
+        line=m.group('after').strip()
         if not line[0]=='/':line='//'+line
         cl=[]
         f=0;bn='';ol=''
         for c in line:
             if c=='/':f=f+1;continue
             if f>=3:
-                bn = string.strip(bn)
+                bn = bn.strip()
                 if not bn: bn='_BLNK_'
                 cl.append([bn,ol])
                 f=f-2;bn='';ol=''
             if f%2: bn=bn+c
             else: ol=ol+c
-        bn = string.strip(bn)
+        bn = bn.strip()
         if not bn: bn='_BLNK_'
         cl.append([bn,ol])
         commonkey={}
@@ -1080,7 +1086,7 @@
                 outmess('analyzeline: previously defined common block encountered. Skipping.\n')
                 continue
             commonkey[c[0]]=[]
-            for i in map(string.strip,string.split(markoutercomma(c[1]),'@,@')):
+            for i in [x.strip() for x in markoutercomma(c[1]).split('@,@')]:
                 if i: commonkey[c[0]].append(i)
         groupcache[groupcounter]['common']=commonkey
         previous_context = ('common',bn,groupcounter)
@@ -1095,12 +1101,12 @@
             if mm.has_key('list') and mm['list'] is not None:
                 if mm.has_key('notonly') and mm['notonly'] is None:isonly=1
                 groupcache[groupcounter]['use'][name]['only']=isonly
-                ll=map(string.strip,string.split(mm['list'],','))
+                ll=[x.strip() for x in mm['list'].split(',')]
                 rl={}
                 for l in ll:
                     if '=' in l:
                         m2=re.match(r'\A\s*(?P<local>\b[\w]+\b)\s*=\s*>\s*(?P<use>\b[\w]+\b)\s*\Z',l,re.I)
-                        if m2: rl[string.strip(m2.group('local'))]=string.strip(m2.group('use'))
+                        if m2: rl[m2.group('local').strip()]=m2.group('use').strip()
                         else:
                             outmess('analyzeline: Not local=>use pattern found in %s\n'%`l`)
                     else:
@@ -1151,7 +1157,7 @@
     attr=None
     if re.match(r'double\s*complex',typespec,re.I): typespec='double complex'
     elif re.match(r'double\s*precision',typespec,re.I): typespec='double precision'
-    else: typespec=string.lower(string.strip(typespec))
+    else: typespec=typespec.strip().lower()
     m1=selectpattern.match(markouterparen(ll))
     if not m1:
         outmess('cracktypespec0: no kind/char_selector pattern found for line.\n')
@@ -1161,9 +1167,9 @@
     if typespec in ['complex','integer','logical','real','character','type']:
         selector=d['this']
         ll=d['after']
-    i=string.find(ll,'::')
+    i=ll.find('::')
     if i>=0:
-        attr=string.strip(ll[:i])
+        attr=ll[:i].strip()
         ll=ll[i+2:]
     return typespec,selector,attr,ll
 #####
@@ -1173,7 +1179,7 @@
 lenkindpattern=re.compile(r'\s*(kind\s*=\s*(?P<kind>.*?)\s*(@,@\s*len\s*=\s*(?P<len>.*)|)|(len\s*=\s*|)(?P<len2>.*?)\s*(@,@\s*(kind\s*=\s*|)(?P<kind2>.*)|))\s*\Z',re.I)
 lenarraypattern=re.compile(r'\s*(@\(@\s*(?!/)\s*(?P<array>.*?)\s*@\)@\s*[*]\s*(?P<len>.*?)|([*]\s*(?P<len2>.*?)|)\s*(@\(@\s*(?!/)\s*(?P<array2>.*?)\s*@\)@|))\s*(=\s*(?P<init>.*?)|(@\(@|)/\s*(?P<init2>.*?)\s*/(@\)@|)|)\s*\Z',re.I)
 def removespaces(expr):
-    expr=string.strip(expr)
+    expr=expr.strip()
     if len(expr)<=1: return expr
     expr2=expr[0]
     for i in range(1,len(expr)-1):
@@ -1203,21 +1209,21 @@
     last_name = None
     kindselect,charselect,typename=cracktypespec(typespec,selector)
     if attrspec:
-        attrspec=map(string.strip,string.split(markoutercomma(attrspec),'@,@'))
+        attrspec=[x.strip() for x in markoutercomma(attrspec).split('@,@')]
         l = []
         c = re.compile(r'(?P<start>[a-zA-Z]+)')
         for a in attrspec:
             m = c.match(a)
             if m:
-                s = string.lower(m.group('start'))
+                s = m.group('start').lower()
                 a = s + a[len(s):]
             l.append(a)
         attrspec = l
-    el=map(string.strip,string.split(markoutercomma(entitydecl),'@,@'))
+    el=[x.strip() for x in markoutercomma(entitydecl).split('@,@')]
     el1=[]
     for e in el:
-        for e1 in map(string.strip,string.split(markoutercomma(removespaces(markinnerspaces(e)),comma=' '),'@ @')):
-            if e1: el1.append(string.replace(e1,'@_@',' '))
+        for e1 in [x.strip() for x in markoutercomma(removespaces(markinnerspaces(e)),comma=' ').split('@ @')]:
+            if e1: el1.append(e1.replace('@_@',' '))
     for e in el1:
         m=namepattern.match(e)
         if not m:
@@ -1430,7 +1436,7 @@
     if not usedict:
         return param_map
     for usename,mapping in usedict.items():
-        usename = string.lower(usename)
+        usename = usename.lower()
         if not f90modulevars.has_key(usename):
             continue
         mvars = f90modulevars[usename]
@@ -1494,7 +1500,7 @@
         for g in block:
             setmesstext(g)
             g=postcrack(g,tab=tab+'\t')
-            if g.has_key('name') and string.find(g['name'],'__user__')>=0: # sort user routines to appear first
+            if g.has_key('name') and '__user__' in g['name']: # sort user routines to appear first
                 uret.append(g)
             else:
                 gret.append(g)
@@ -1518,7 +1524,7 @@
     if block.has_key('use'):
         useblock=block['use']
         for k in useblock.keys():
-            if string.find(k,'__user__')>=0:
+            if '__user__' in k:
                 userisdefined.append(k)
 ##                 if useblock[k].has_key('map'):
 ##                     for n in useblock[k]['map'].values():
@@ -1594,7 +1600,7 @@
             if i>n:
                 errmess('sortvarnames: failed to compute dependencies because'
                         ' of cyclic dependencies between '
-                        +string.join(dep,', ')+'\n')
+                        +', '.join(dep)+'\n')
                 indep = indep + dep
                 break
         else:
@@ -1615,16 +1621,16 @@
             if m:
                 dims=[]
                 if m.group('dims'):
-                    dims=map(string.strip,string.split(markoutercomma(m.group('dims')),'@,@'))
-                n=string.strip(m.group('name'))
+                    dims=[x.strip() for x in markoutercomma(m.group('dims')).split('@,@')]
+                n=m.group('name').strip()
                 if block['vars'].has_key(n):
                     if block['vars'][n].has_key('attrspec'):
-                        block['vars'][n]['attrspec'].append('dimension(%s)'%(string.join(dims,',')))
+                        block['vars'][n]['attrspec'].append('dimension(%s)'%(','.join(dims)))
                     else:
-                        block['vars'][n]['attrspec']=['dimension(%s)'%(string.join(dims,','))]
+                        block['vars'][n]['attrspec']=['dimension(%s)'%(','.join(dims))]
                 else:
                     if dims:
-                        block['vars'][n]={'attrspec':['dimension(%s)'%(string.join(dims,','))]}
+                        block['vars'][n]={'attrspec':['dimension(%s)'%(','.join(dims))]}
                     else: block['vars'][n]={}
                 if n not in commonvars: commonvars.append(n)
             else:
@@ -1657,7 +1663,7 @@
         if b['block']=='interface' and not b['body']:
             if not b.has_key('f2pyenhancements'):
                 continue
-        if string.replace(b['block'],' ','')=='pythonmodule':
+        if b['block'].replace(' ','')=='pythonmodule':
             usermodules.append(b)
         else:
             if b['block']=='module':
@@ -1926,7 +1932,7 @@
                 for m in real16pattern.finditer(v):
                     tt[m.start():m.end()] = list(\
                             v[m.start():m.end()].lower().replace('d', 'e'))
-                v = string.join(tt,'')
+                v = ''.join(tt)
             if iscomplex(vars[n]):
                 if v[0]=='(' and v[-1]==')':
                     l = markoutercomma(v[1:-1]).split('@,@')
@@ -1939,7 +1945,7 @@
                 outmess('get_parameters: got "%s" on %s\n' % (msg,`v`))
             if isstring(vars[n]) and type(params[n]) is type(0):
                 params[n] = chr(params[n])
-            nl = string.lower(n)
+            nl = n.lower()
             if nl!=n:
                 params[nl] = params[n]
         else:
@@ -2011,7 +2017,7 @@
         if not vars[n].has_key('typespec'):
             if not(vars[n].has_key('attrspec') and 'external' in vars[n]['attrspec']):
                 if implicitrules:
-                    ln0 = string.lower(n[0])
+                    ln0 = n[0].lower()
                     for k in implicitrules[ln0].keys():
                         if k=='typespec' and implicitrules[ln0][k]=='undefined':
                             continue
@@ -2048,39 +2054,39 @@
             vars[n]['attrspec']=[]
             dim,intent,depend,check,note=None,None,None,None,None
             for a in attr:
-                if a[:9]=='dimension': dim=(string.strip(a[9:]))[1:-1]
-                elif a[:6]=='intent': intent=(string.strip(a[6:]))[1:-1]
-                elif a[:6]=='depend': depend=(string.strip(a[6:]))[1:-1]
-                elif a[:5]=='check': check=(string.strip(a[5:]))[1:-1]
-                elif a[:4]=='note': note=(string.strip(a[4:]))[1:-1]
+                if a[:9]=='dimension': dim=(a[9:].strip())[1:-1]
+                elif a[:6]=='intent': intent=(a[6:].strip())[1:-1]
+                elif a[:6]=='depend': depend=(a[6:].strip())[1:-1]
+                elif a[:5]=='check': check=(a[5:].strip())[1:-1]
+                elif a[:4]=='note': note=(a[4:].strip())[1:-1]
                 else: vars[n]=setattrspec(vars[n],a)
                 if intent:
                     if not vars[n].has_key('intent'): vars[n]['intent']=[]
-                    for c in map(string.strip,string.split(markoutercomma(intent),'@,@')):
+                    for c in [x.strip() for x in markoutercomma(intent).split('@,@')]:
                         if not c in vars[n]['intent']:
                             vars[n]['intent'].append(c)
                     intent=None
                 if note:
-                    note=string.replace(note,'\\n\\n','\n\n')
-                    note=string.replace(note,'\\n ','\n')
+                    note=note.replace('\\n\\n','\n\n')
+                    note=note.replace('\\n ','\n')
                     if not vars[n].has_key('note'): vars[n]['note']=[note]
                     else: vars[n]['note'].append(note)
                     note=None
                 if depend is not None:
                     if not vars[n].has_key('depend'): vars[n]['depend']=[]
-                    for c in rmbadname(map(string.strip,string.split(markoutercomma(depend),'@,@'))):
+                    for c in rmbadname([x.strip() for x in markoutercomma(depend).split('@,@')]):
                         if c not in vars[n]['depend']:
                             vars[n]['depend'].append(c)
                     depend=None
                 if check is not None:
                     if not vars[n].has_key('check'): vars[n]['check']=[]
-                    for c in map(string.strip,string.split(markoutercomma(check),'@,@')):
+                    for c in [x.strip() for x in markoutercomma(check).split('@,@')]:
                         if not c in vars[n]['check']:
                             vars[n]['check'].append(c)
                     check=None
             if dim and not vars[n].has_key('dimension'):
                 vars[n]['dimension']=[]
-                for d in rmbadname(map(string.strip,string.split(markoutercomma(dim),'@,@'))):
+                for d in rmbadname([x.strip() for x in markoutercomma(dim).split('@,@')]):
                     star = '*'
                     if d==':': star=':'
                     if params.has_key(d):
@@ -2093,7 +2099,7 @@
                     if d==star:
                         dl = [star]
                     else:
-                        dl=string.split(markoutercomma(d,':'),'@:@')
+                        dl=markoutercomma(d,':').split('@:@')
                     if len(dl)==2 and '*' in dl: # e.g. dimension(5:*)
                         dl = ['*']
                         d = '*'
@@ -2153,7 +2159,7 @@
                         if vars[d].has_key('attrspec'):
                             for aa in vars[d]['attrspec']:
                                 if aa[:6]=='depend':
-                                    ddeps=ddeps+string.split((string.strip(aa[6:]))[1:-1],',')
+                                    ddeps += aa[6:].strip()[1:-1].split(',')
                         if vars[d].has_key('depend'):
                             ddeps=ddeps+vars[d]['depend']
                     i=i+1
@@ -2223,9 +2229,9 @@
                     vars[n]=appenddecl(vars[n],vars[block['result']])
                 if block.has_key('prefix'):
                     pr=block['prefix']; ispure=0; isrec=1
-                    pr1=string.replace(pr,'pure','')
+                    pr1=pr.replace('pure','')
                     ispure=(not pr==pr1)
-                    pr=string.replace(pr1,'recursive','')
+                    pr=pr1.replace('recursive','')
                     isrec=(not pr==pr1)
                     m=typespattern[0].match(pr)
                     if m:
@@ -2332,7 +2338,7 @@
 def determineexprtype(expr,vars,rules={}):
     if vars.has_key(expr):
         return _ensure_exprdict(vars[expr])
-    expr=string.strip(expr)
+    expr=expr.strip()
     if determineexprtype_re_1.match(expr):
         return {'typespec':'complex'}
     m=determineexprtype_re_2.match(expr)
@@ -2346,7 +2352,7 @@
             outmess('determineexprtype: selected kind types not supported (%s)\n'%`expr`)
         return {'typespec':'real'}
     for op in ['+','-','*','/']:
-        for e in map(string.strip,string.split(markoutercomma(expr,comma=op),'@'+op+'@')):
+        for e in [x.strip() for x in markoutercomma(expr,comma=op).split('@'+op+'@')]:
             if vars.has_key(e):
                 return _ensure_exprdict(vars[e])
     t={}
@@ -2391,7 +2397,7 @@
         vars = block['vars']
         al = [a for a in block['args'] if not isintent_callback(vars[a])]
         if block['block']=='function' or al:
-            args='(%s)'%string.join(al,',')
+            args='(%s)'%','.join(al)
     f2pyenhancements = ''
     if block.has_key('f2pyenhancements'):
         for k in block['f2pyenhancements'].keys():
@@ -2402,7 +2408,7 @@
     if intent_lst:
         f2pyenhancements = '%s%sintent(%s) %s'%\
                            (f2pyenhancements,tab+tabchar,
-                            string.join(intent_lst,','),name)
+                            ','.join(intent_lst),name)
     use=''
     if block.has_key('use'):
         use=use2fortran(block['use'],tab+tabchar)
@@ -2425,7 +2431,7 @@
         entry_stmts = ''
         for k,i in block['entry'].items():
             entry_stmts = '%s%sentry %s(%s)' \
-                          % (entry_stmts,tab+tabchar,k,string.join(i,','))
+                          % (entry_stmts,tab+tabchar,k,','.join(i))
         body = body + entry_stmts
     if blocktype=='block data' and name=='_BLOCK_DATA_':
         name = ''
@@ -2435,9 +2441,9 @@
     ret=''
     for k in common.keys():
         if k=='_BLNK_':
-            ret='%s%scommon %s'%(ret,tab,string.join(common[k],','))
+            ret='%s%scommon %s'%(ret,tab,','.join(common[k]))
         else:
-            ret='%s%scommon /%s/ %s'%(ret,tab,k,string.join(common[k],','))
+            ret='%s%scommon /%s/ %s'%(ret,tab,k,','.join(common[k]))
     return ret
 def use2fortran(use,tab=''):
     ret=''
@@ -2546,23 +2552,23 @@
                 if l not in ['external']:
                     attr.append(l)
             if attr:
-                vardef='%s %s'%(vardef,string.join(attr,','))
+                vardef='%s %s'%(vardef,','.join(attr))
                 c=','
         if vars[a].has_key('dimension'):
 #             if not isintent_c(vars[a]):
 #                 vars[a]['dimension'].reverse()
-            vardef='%s%sdimension(%s)'%(vardef,c,string.join(vars[a]['dimension'],','))
+            vardef='%s%sdimension(%s)'%(vardef,c,','.join(vars[a]['dimension']))
             c=','
         if vars[a].has_key('intent'):
             lst = true_intent_list(vars[a])
             if lst:
-                vardef='%s%sintent(%s)'%(vardef,c,string.join(lst,','))
+                vardef='%s%sintent(%s)'%(vardef,c,','.join(lst))
             c=','
         if vars[a].has_key('check'):
-            vardef='%s%scheck(%s)'%(vardef,c,string.join(vars[a]['check'],','))
+            vardef='%s%scheck(%s)'%(vardef,c,','.join(vars[a]['check']))
             c=','
         if vars[a].has_key('depend'):
-            vardef='%s%sdepend(%s)'%(vardef,c,string.join(vars[a]['depend'],','))
+            vardef='%s%sdepend(%s)'%(vardef,c,','.join(vars[a]['depend']))
             c=','
         if vars[a].has_key('='):
             v = vars[a]['=']

Modified: branches/numpy.scons/numpy/f2py/doc/collectinput.py
===================================================================
--- branches/numpy.scons/numpy/f2py/doc/collectinput.py	2007-11-13 13:10:59 UTC (rev 4450)
+++ branches/numpy.scons/numpy/f2py/doc/collectinput.py	2007-11-13 13:51:35 UTC (rev 4451)
@@ -22,7 +22,11 @@
 __version__ = "0.0"
 
 stdoutflag=0
-import sys,os,string,fileinput,re,commands
+import sys
+import os
+import fileinput
+import re
+import commands
 
 try: fn=sys.argv[2]
 except:
@@ -46,7 +50,7 @@
         l=l[:m.end()-1]
     m=input.match(l)
     if m:
-        l=string.strip(l)
+        l=l.strip()
         if l[-1]=='}': l=l[:-1]
         i=m.end()-2
         sys.stderr.write('>>>>>>')

Modified: branches/numpy.scons/numpy/f2py/f2py2e.py
===================================================================
--- branches/numpy.scons/numpy/f2py/f2py2e.py	2007-11-13 13:10:59 UTC (rev 4450)
+++ branches/numpy.scons/numpy/f2py/f2py2e.py	2007-11-13 13:51:35 UTC (rev 4451)
@@ -18,7 +18,12 @@
 import __version__
 f2py_version = __version__.version
 
-import sys,os,string,pprint,shutil,types,re
+import sys
+import os
+import pprint
+import shutil
+import types
+import re
 errmess=sys.stderr.write
 #outmess=sys.stdout.write
 show=pprint.pprint
@@ -289,7 +294,7 @@
     outmess('Building modules...\n')
     modules,mnames,isusedby=[],[],{}
     for i in range(len(list)):
-        if string.find(list[i]['name'],'__user__')>=0:
+        if '__user__' in list[i]['name']:
             cb_rules.buildcallbacks(list[i])
         else:
             if list[i].has_key('use'):
@@ -301,7 +306,7 @@
     ret = {}
     for i in range(len(mnames)):
         if isusedby.has_key(mnames[i]):
-            outmess('\tSkipping module "%s" which is used by %s.\n'%(mnames[i],string.join(map(lambda s:'"%s"'%s,isusedby[mnames[i]]),',')))
+            outmess('\tSkipping module "%s" which is used by %s.\n'%(mnames[i],','.join(map(lambda s:'"%s"'%s,isusedby[mnames[i]]))))
         else:
             um=[]
             if modules[i].has_key('use'):
@@ -341,10 +346,10 @@
                 if not isusedby.has_key(u): isusedby[u]=[]
                 isusedby[u].append(postlist[i]['name'])
     for i in range(len(postlist)):
-        if postlist[i]['block']=='python module' and string.find(postlist[i]['name'],'__user__')<0:
+        if postlist[i]['block']=='python module' and '__user__' in postlist[i]['name']:
             if isusedby.has_key(postlist[i]['name']):
                 #if not quiet:
-                outmess('Skipping Makefile build for module "%s" which is used by %s\n'%(postlist[i]['name'],string.join(map(lambda s:'"%s"'%s,isusedby[postlist[i]['name']]),',')))
+                outmess('Skipping Makefile build for module "%s" which is used by %s\n'%(postlist[i]['name'],','.join(map(lambda s:'"%s"'%s,isusedby[postlist[i]['name']]))))
     if options.has_key('signsfile'):
         if options['verbose']>1:
             outmess('Stopping. Edit the signature file and then run f2py on the signature file: ')
@@ -375,7 +380,7 @@
         ind = len(prefix)
     else:
         ind = 0
-    for file in map(string.strip,files):
+    for file in [x.strip() for x in files]:
         if match(file): filtered.append(file[ind:])
         else: rest.append(file)
     return filtered,rest
@@ -485,7 +490,7 @@
     using_numarray = 0
     using_numeric = 0
     for i in range(len(define_macros)):
-        name_value = string.split(define_macros[i],'=',1)
+        name_value = define_macros[i].split('=',1)
         if len(name_value)==1:
             name_value.append(None)
         if len(name_value)==2:

Modified: branches/numpy.scons/numpy/f2py/f90mod_rules.py
===================================================================
--- branches/numpy.scons/numpy/f2py/f90mod_rules.py	2007-11-13 13:10:59 UTC (rev 4450)
+++ branches/numpy.scons/numpy/f2py/f90mod_rules.py	2007-11-13 13:51:35 UTC (rev 4451)
@@ -18,7 +18,10 @@
 f2py_version='See `f2py -v`'
 
 import pprint
-import sys,string,time,types,copy
+import sys
+import time
+import types
+import copy
 errmess=sys.stderr.write
 outmess=sys.stdout.write
 show=pprint.pprint
@@ -107,7 +110,7 @@
                 mfargs.append(n)
         outmess('\t\tConstructing F90 module support for "%s"...\n'%(m['name']))
         if onlyvars:
-            outmess('\t\t  Variables: %s\n'%(string.join(onlyvars)))
+            outmess('\t\t  Variables: %s\n'%(' '.join(onlyvars)))
         chooks=['']
         def cadd(line,s=chooks): s[0] = '%s\n%s'%(s[0],line)
         ihooks=['']
@@ -118,7 +121,7 @@
         dadd('\\subsection{Fortran 90/95 module \\texttt{%s}}\n'%(m['name']))
         if hasnote(m):
             note = m['note']
-            if type(note) is type([]): note=string.join(note,'\n')
+            if type(note) is type([]): note='\n'.join(note)
             dadd(note)
         if onlyvars:
             dadd('\\begin{description}')
@@ -128,8 +131,8 @@
             ct = capi_maps.getctype(var)
             at = capi_maps.c2capi_map[ct]
             dm = capi_maps.getarrdims(n,var)
-            dms = string.strip(string.replace(dm['dims'],'*','-1'))
-            dms = string.strip(string.replace(dms,':','-1'))
+            dms = dm['dims'].replace('*','-1').strip()
+            dms = dms.replace(':','-1').strip()
             if not dms: dms='-1'
             use_fgetdims2 = fgetdims2
             if isstringarray(var):
@@ -144,7 +147,7 @@
             dadd('\\item[]{{}\\verb@%s@{}}'%(capi_maps.getarrdocsign(n,var)))
             if hasnote(var):
                 note = var['note']
-                if type(note) is type([]): note=string.join(note,'\n')
+                if type(note) is type([]): note='\n'.join(note)
                 dadd('--- %s'%(note))
             if isallocatable(var):
                 fargs.append('f2py_%s_getdims_%s'%(m['name'],n))
@@ -157,7 +160,7 @@
                 fadd('integer flag\n')
                 fhooks[0]=fhooks[0]+fgetdims1
                 dms = eval('range(1,%s+1)'%(dm['rank']))
-                fadd(' allocate(d(%s))\n'%(string.join(map(lambda i:'s(%s)'%i,dms),',')))
+                fadd(' allocate(d(%s))\n'%(','.join(map(lambda i:'s(%s)'%i,dms))))
                 fhooks[0]=fhooks[0]+use_fgetdims2
                 fadd('end subroutine %s'%(fargs[-1]))
             else:
@@ -197,16 +200,16 @@
                 iadd('\tf2py_%s_def[i_f2py++].data = %s;'%(m['name'],b['name']))
         cadd('\t{NULL}\n};\n')
         iadd('}')
-        ihooks[0]='static void f2py_setup_%s(%s) {\n\tint i_f2py=0;%s'%(m['name'],string.join(sargs,','),ihooks[0])
+        ihooks[0]='static void f2py_setup_%s(%s) {\n\tint i_f2py=0;%s'%(m['name'],','.join(sargs),ihooks[0])
         if '_' in m['name']:
             F_FUNC='F_FUNC_US'
         else:
             F_FUNC='F_FUNC'
         iadd('extern void %s(f2pyinit%s,F2PYINIT%s)(void (*)(%s));'\
-             %(F_FUNC,m['name'],string.upper(m['name']),string.join(sargsp,',')))
+             %(F_FUNC,m['name'],m['name'].upper(),','.join(sargsp)))
         iadd('static void f2py_init_%s(void) {'%(m['name']))
         iadd('\t%s(f2pyinit%s,F2PYINIT%s)(f2py_setup_%s);'\
-             %(F_FUNC,m['name'],string.upper(m['name']),m['name']))
+             %(F_FUNC,m['name'],m['name'].upper(),m['name']))
         iadd('}\n')
         ret['f90modhooks']=ret['f90modhooks']+chooks+ihooks
         ret['initf90modhooks']=['\tPyDict_SetItemString(d, "%s", PyFortranObject_New(f2py_%s_def,f2py_init_%s));'%(m['name'],m['name'],m['name'])]+ret['initf90modhooks']
@@ -217,20 +220,20 @@
             for a in undo_rmbadname(mfargs):
                 fadd('use %s, only : %s'%(m['name'],a))
         if ifargs:
-            fadd(string.join(['interface']+ifargs))
+            fadd(' '.join(['interface']+ifargs))
             fadd('end interface')
         fadd('external f2pysetupfunc')
         if efargs:
             for a in undo_rmbadname(efargs):
                 fadd('external %s'%(a))
-        fadd('call f2pysetupfunc(%s)'%(string.join(undo_rmbadname(fargs),',')))
+        fadd('call f2pysetupfunc(%s)'%(','.join(undo_rmbadname(fargs))))
         fadd('end subroutine f2pyinit%s\n'%(m['name']))
 
-        dadd(string.replace(string.join(ret['latexdoc'],'\n'),r'\subsection{',r'\subsubsection{'))
+        dadd('\n'.join(ret['latexdoc']).replace(r'\subsection{',r'\subsubsection{'))
 
         ret['latexdoc']=[]
         ret['docs'].append('"\t%s --- %s"'%(m['name'],
-                                            string.join(undo_rmbadname(modobjs),',')))
+                                            ','.join(undo_rmbadname(modobjs))))
 
     ret['routine_defs']=''
     ret['doc']=[]

Modified: branches/numpy.scons/numpy/f2py/func2subr.py
===================================================================
--- branches/numpy.scons/numpy/f2py/func2subr.py	2007-11-13 13:10:59 UTC (rev 4450)
+++ branches/numpy.scons/numpy/f2py/func2subr.py	2007-11-13 13:51:35 UTC (rev 4451)
@@ -17,8 +17,12 @@
 
 f2py_version='See `f2py -v`'
 
-import pprint,copy
-import sys,string,time,types,copy
+import pprint
+import copy
+import sys
+import time
+import types
+import copy
 errmess=sys.stderr.write
 outmess=sys.stdout.write
 show=pprint.pprint
@@ -69,7 +73,7 @@
 
     vardef='%s %s'%(vardef,fa)
     if vars[a].has_key('dimension'):
-        vardef='%s(%s)'%(vardef,string.join(vars[a]['dimension'],','))
+        vardef='%s(%s)'%(vardef,','.join(vars[a]['dimension']))
     return vardef
 
 def createfuncwrapper(rout,signature=0):
@@ -98,12 +102,12 @@
         if charselect.get('*','')=='(*)':
             charselect['*'] = '10'
     if f90mode:
-        sargs = string.join(args,', ')
+        sargs = ', '.join(args)
         add('subroutine f2pywrap_%s_%s (%s)'%(rout['modulename'],name,sargs))
         if not signature:
             add('use %s, only : %s'%(rout['modulename'],fortranname))
     else:
-        add('subroutine f2pywrap%s (%s)'%(name,string.join(args,', ')))
+        add('subroutine f2pywrap%s (%s)'%(name,', '.join(args)))
         add('external %s'%(fortranname))
         #if not return_char_star:
         l = l + ', '+fortranname
@@ -126,9 +130,9 @@
 
     if not signature:
         if islogicalfunction(rout):
-            add('%s = .not.(.not.%s(%s))'%(newname,fortranname,string.join(args,', ')))
+            add('%s = .not.(.not.%s(%s))'%(newname,fortranname,', '.join(args)))
         else:
-            add('%s = %s(%s)'%(newname,fortranname,string.join(args,', ')))
+            add('%s = %s(%s)'%(newname,fortranname,', '.join(args)))
     if f90mode:
         add('end subroutine f2pywrap_%s_%s'%(rout['modulename'],name))
     else:

Modified: branches/numpy.scons/numpy/f2py/lib/extgen/base.py
===================================================================
--- branches/numpy.scons/numpy/f2py/lib/extgen/base.py	2007-11-13 13:10:59 UTC (rev 4450)
+++ branches/numpy.scons/numpy/f2py/lib/extgen/base.py	2007-11-13 13:51:35 UTC (rev 4451)
@@ -53,7 +53,6 @@
         obj = obj.initialize(*args, **kws)    # initialize from constructor arguments
         return obj
 
-    @property
     def components(self):
         if Component._running_generate:
             try:
@@ -65,7 +64,8 @@
             self._generate_components[Component._running_generate_id] = l = list(self._components)
             return l
         return self._components
-        
+    components = property(components)
+
     def initialize(self, *components, **options):
         """
         Set additional attributes, add components to instance, etc.
@@ -83,24 +83,25 @@
     def __repr__(self):
         return '%s(%s)' % (self.__class__.__name__, ', '.join([repr(c) for (c,l) in self.components]))
 
-    @property
     def provides(self):
         """
         Return a code idiom name that the current class defines.
-        
+
         Used in avoiding redefinitions of functions and variables.
         """
         if self._provides is None:
             return '%s_%s' % (self.__class__.__name__, id(self))
         return self._provides
+    provides = property(provides)
 
-    @staticmethod
     def warning(message):
         #raise RuntimeError('extgen:' + message)
         print >> sys.stderr, 'extgen:',message
-    @staticmethod
+    warning = staticmethod(warning)
+
     def info(message):
         print >> sys.stderr, message
+    info = staticmethod(info)
 
     def __getattr__(self, attr):
         if attr.startswith('container_'): # convenience feature
@@ -114,7 +115,6 @@
         return self
     __iadd__ = __add__
 
-    @staticmethod
     def _get_class_names(cls):
         if not issubclass(cls, Component):
             return [cls]
@@ -122,7 +122,8 @@
         for b in cls.__bases__:
             r += Component._get_class_names(b)
         return r
-        
+    _get_class_names = staticmethod(_get_class_names)
+
     def add(self, component, container_label=None):
         """
         Append component and its target container label to components list.
@@ -204,7 +205,7 @@
         return evaluated template strings.
         """
         #self.finalize()
-        
+
         # clean up containers
         self.containers = {}
         for n in dir(self):
@@ -248,7 +249,7 @@
                     container = component.get_container(k)
                     container.add(r, component.provides)
             else:
-                
+
                 self.warning('%s: no container label specified for component providing %r'\
                                  % (self.__class__.__name__,component.provides))
             component.parent = old_parent
@@ -283,7 +284,7 @@
 
     def get_container(self, name):
         """ Return named container.
-        
+
         Rules for returning containers:
         (1) return local container if exists
         (2) return parent container if exists
@@ -294,7 +295,7 @@
             return self.containers[name]
         except KeyError:
             pass
-        
+
         # parent container
         parent = self.parent
         while parent is not None:
@@ -349,7 +350,6 @@
 
     _registered_components_map = {}
 
-    @staticmethod
     def register(*components):
         """
         Register components so that component classes can use
@@ -363,8 +363,8 @@
             else:
                 d[provides] = component
         return
+    register = staticmethod(register)
 
-    @staticmethod
     def get(provides):
         """
         Return predefined component with given provides property..
@@ -374,13 +374,13 @@
         except KeyError:
             pass
         raise KeyError('no registered component provides %r' % (provides))
+    get = staticmethod(get)
 
-    @property
     def numpy_version(self):
         import numpy
         return numpy.__version__
+    numpy_version = property(numpy_version)
 
-    
 class Container(object):
     """
     Container of a list of named strings.
@@ -401,7 +401,7 @@
     >>> c += c2
     >>> print c
     "hey, hoo, bar"
-    
+
     """
     __metaclass__ = ComponentMetaClass
 
@@ -435,7 +435,7 @@
         self.replace_map = replace_map
         self.ignore_empty_content = ignore_empty_content
         self.skip_prefix_suffix_when_single = skip_prefix_suffix_when_single
-        
+
     def __nonzero__(self):
         return bool(self.list)
 
@@ -452,7 +452,7 @@
             for i,l in lst:
                 self.add(other.list[i], l)
         else:
-            self.add(other)        
+            self.add(other)
         return self
     __iadd__ = __add__
 
@@ -532,12 +532,12 @@
             lst = [(i,l) for (l,i) in self.label_map.items()]
             lst.sort()
             for i,l in lst:
-                cpy.add(mapping(other.list[i]), l)            
+                cpy.add(mapping(other.list[i]), l)
         return cpy
 
 def _test():
     import doctest
     doctest.testmod()
-    
+
 if __name__ == "__main__":
     _test()

Modified: branches/numpy.scons/numpy/f2py/lib/extgen/c_support.py
===================================================================
--- branches/numpy.scons/numpy/f2py/lib/extgen/c_support.py	2007-11-13 13:10:59 UTC (rev 4450)
+++ branches/numpy.scons/numpy/f2py/lib/extgen/c_support.py	2007-11-13 13:51:35 UTC (rev 4451)
@@ -177,7 +177,7 @@
   %(CDeclaration)s
   %(CBody)s
 }'''
-    
+
     container_options = dict(
         CArgument = dict(separator=', ', default='void'),
         CDeclaration = dict(default='<KILLLINE>', use_indent=True, ignore_empty_content=True,
@@ -215,7 +215,7 @@
     >>> h = CHeader('noddy.h')
     >>> print h.generate()
     #include "noddy.h"
-    
+
     """
     template = '#include "%(line)s"'
 
@@ -288,6 +288,6 @@
 def _test():
     import doctest
     doctest.testmod()
-    
+
 if __name__ == "__main__":
     _test()

Modified: branches/numpy.scons/numpy/f2py/lib/extgen/py_support.py
===================================================================
--- branches/numpy.scons/numpy/f2py/lib/extgen/py_support.py	2007-11-13 13:10:59 UTC (rev 4450)
+++ branches/numpy.scons/numpy/f2py/lib/extgen/py_support.py	2007-11-13 13:51:35 UTC (rev 4451)
@@ -80,7 +80,7 @@
 
         self.cdecl = PyCModuleCDeclaration(pyname)
         self += self.cdecl
-        
+
         self.main = PyCModuleInitFunction(pyname)
         self += self.main
         map(self.add, components)
@@ -93,7 +93,7 @@
     def update_SetupPy(self, parent):
         parent.setup_py += self.evaluate('    config.add_extension(%(pyname)r, sources = ["%(extmodulesrc)s"])',
                                          extmodulesrc = self.path)
-        parent.init_py += 'import %s' % (self.pyname)        
+        parent.init_py += 'import %s' % (self.pyname)
 
     def finalize(self):
         if self.need_numpy_support:
@@ -113,7 +113,7 @@
 
     def build(self, build_dir=None, clean_at_exit=None):
         """ build(build_dir=None, clean_at_exit=None)
-        
+
         A convenience function to build, import, an return
         an extension module object.
         """
@@ -123,7 +123,7 @@
             packagename = 'extgen_' + str(hex(int(time.time()*10000000)))[2:]
             build_dir = os.path.join(tempfile.gettempdir(), packagename)
             clean_at_exit = True
-            
+
         setup = Component.SetupPy(build_dir)
         setup += self
         s,o = setup.execute('build_ext','--inplace')
@@ -185,7 +185,7 @@
         )
 
     default_component_class_name = 'Line'
-    
+
     def initialize(self, pyname):
         self.pyname = pyname
         return self
@@ -225,8 +225,8 @@
       }
       return;
     }
-    """    
-    
+    """
+
     template = '''\
 %(CSpecifier)s
 %(CTypeSpec)s
@@ -320,7 +320,7 @@
         map(self.add, components)
         return self
     def update_containers(self):
-        self.container_OptExtArg += self.container_OptArg + self.container_ExtArg    
+        self.container_OptExtArg += self.container_OptArg + self.container_ExtArg
 
 class PyCFunction(CFunction):
 
@@ -329,7 +329,7 @@
     >>> f = PyCFunction('foo')
     >>> print f.generate()
     static
-    char pyc_function_foo_doc[] = 
+    char pyc_function_foo_doc[] =
     \"  foo() -> None\"
     \"\\n\\n:Returns:\\n  None\"
     ;
@@ -366,7 +366,7 @@
 
     template = '''\
 static
-char %(name)s_doc[] = 
+char %(name)s_doc[] =
 "  %(FunctionSignature)s"
 %(Title)s
 %(Description)s
@@ -399,7 +399,7 @@
 }'''
 
     container_options = CFunction.container_options.copy()
-    
+
     container_options.update(\
 
         TMP = dict(),
@@ -429,13 +429,13 @@
         ReqKWList = ReqKWList.parent_container_options,
         OptKWList = OptKWList.parent_container_options,
         ExtKWList = ExtKWList.parent_container_options,
-        
+
         ReqArgFmt = ReqArgFmt.parent_container_options,
         OptArgFmt = OptArgFmt.parent_container_options,
         ExtArgFmt = ExtArgFmt.parent_container_options,
         OptExtArgFmt = OptExtArgFmt.ExtArgFmt.parent_container_options,
         RetArgFmt = ExtArgFmt.parent_container_options,
-        
+
         ReqArgObj = ReqArgObj.parent_container_options,
         OptArgObj = OptArgObj.parent_container_options,
         ExtArgObj = ExtArgObj.parent_container_options,
@@ -443,7 +443,7 @@
 
         FromPyObj = CCode.parent_container_options,
         PyObjFrom = CCode.parent_container_options,
-        
+
         CleanPyObjFrom = dict(default='<KILLLINE>', reverse=True, use_indent=True, ignore_empty_content=True),
         CleanCBody = dict(default='<KILLLINE>', reverse=True, use_indent=True, ignore_empty_content=True),
         CleanFromPyObj = dict(default='<KILLLINE>', reverse=True, use_indent=True, ignore_empty_content=True),
@@ -457,7 +457,7 @@
         PyCArgument = 'TMP',
         CCode = 'CBody',
         )
-    
+
     def initialize(self, pyname, *components, **options):
         self.pyname = pyname
         self.title = options.pop('title', None)
@@ -483,7 +483,7 @@
         t = '  {"%(pyname)s", (PyCFunction)%(name)s, METH_VARARGS | METH_KEYWORDS, %(name)s_doc}'
         parent.cdecl.add(self.evaluate(t),'PyMethodDef')
         parent.cdecl.add(self.signature,'FunctionSignature')
-        
+
     def update_containers(self):
         self.container_OptExtArg += self.container_OptArg + self.container_ExtArg
         self.container_OptExtArgFmt += self.container_OptArgFmt + self.container_ExtArgFmt
@@ -585,7 +585,7 @@
                 if self.output_description is None:
                     self.output_description = description
         if options: self.warning('%s unused options: %s\n' % (self.__class__.__name__, options))
-        
+
         self.name = name
         self.ctype = ctype = PyCTypeSpec(ctype)
         self += ctype
@@ -613,8 +613,8 @@
             self.retpycvar = name + '_pyc_r'
 
         ctype.set_titles(self)
-        
-        map(self.add, components)        
+
+        map(self.add, components)
         return self
 
     def __repr__(self):
@@ -668,7 +668,7 @@
             pass
         else:
             raise NotImplementedError('input_intent=%r' % (self.input_intent))
-            
+
         if self.output_intent=='return':
             parent += RetArg(self.name)
             parent.signature += RetArg(self.name)
@@ -679,11 +679,11 @@
         elif self.output_intent=='hide':
             pass
         else:
-            raise NotImplementedError('output_intent=%r' % (self.output_intent))        
+            raise NotImplementedError('output_intent=%r' % (self.output_intent))
 
 class PyCReturn(PyCArgument):
 
-    def initialize(self, name, ctype = object, *components, **options):    
+    def initialize(self, name, ctype = object, *components, **options):
         return PyCArgument(name, ctype, input_intent='hide', output_intent='return', *components, **options)
 
 class PyCTypeSpec(CTypeSpec):
@@ -898,7 +898,7 @@
         c_long = (None,'long', 'l', 'l', '0'),
         c_unsigned_long = (None,'unsigned long', 'k', 'k', '0'),
         c_long_long = (None,'PY_LONG_LONG', 'L', 'L', '0'),
-        c_unsigned_long_long = (None,'unsigned PY_LONG_LONG', 'K', 'K', '0'),        
+        c_unsigned_long_long = (None,'unsigned PY_LONG_LONG', 'K', 'K', '0'),
         c_Py_ssize_t = (None,'Py_ssize_t', 'n', 'n', '0'),
         c_char1 = (None,'char', 'c', 'c', '"\\0"'),
         c_float = (None,'float', 'f', 'f', '0.0'),
@@ -911,7 +911,7 @@
     def initialize(self, typeobj):
         if isinstance(typeobj, self.__class__):
             return typeobj
-        
+
         m = self.typeinfo_map
 
         key = None
@@ -955,7 +955,7 @@
             #self.add(Component.get('import_array'), 'ModuleInit')
         if key.startswith('numeric_'):
             raise NotImplementedError(self.__class__.__name__ + ': Numeric support')
-        
+
         return self
 
     def finalize(self):
@@ -1099,6 +1099,6 @@
 def _test():
     import doctest
     doctest.testmod()
-    
+
 if __name__ == "__main__":
     _test()

Modified: branches/numpy.scons/numpy/f2py/lib/extgen/setup_py.py
===================================================================
--- branches/numpy.scons/numpy/f2py/lib/extgen/setup_py.py	2007-11-13 13:10:59 UTC (rev 4450)
+++ branches/numpy.scons/numpy/f2py/lib/extgen/setup_py.py	2007-11-13 13:51:35 UTC (rev 4451)
@@ -51,7 +51,7 @@
     >>> import SetupPy_doctest as mypackage
     >>> print mypackage.foo.__doc__ #doctest: +ELLIPSIS
     This module 'foo' is generated with ExtGen from NumPy version...
-    
+
     """
     template_setup_py_start = '''\
 def configuration(parent_package='', top_path = ''):
@@ -88,7 +88,7 @@
 
         self += init_py
         self += setup_py
-        
+
         map(self.add, components)
 
         return self
@@ -115,10 +115,10 @@
             self.info('leaving %r directory' % (self.path))
         return r
 
-    
+
 def _test():
     import doctest
     doctest.testmod()
-    
+
 if __name__ == "__main__":
     _test()

Modified: branches/numpy.scons/numpy/f2py/lib/extgen/utils.py
===================================================================
--- branches/numpy.scons/numpy/f2py/lib/extgen/utils.py	2007-11-13 13:10:59 UTC (rev 4450)
+++ branches/numpy.scons/numpy/f2py/lib/extgen/utils.py	2007-11-13 13:51:35 UTC (rev 4451)
@@ -104,7 +104,7 @@
       Line = 'Content',
       Code = 'Content',
     )
-    
+
     def initialize(self, path, *components, **options):
         self.path = path
         map(self.add, components)
@@ -121,6 +121,6 @@
 def _test():
     import doctest
     doctest.testmod()
-    
+
 if __name__ == "__main__":
     _test()

Modified: branches/numpy.scons/numpy/f2py/lib/main.py
===================================================================
--- branches/numpy.scons/numpy/f2py/lib/main.py	2007-11-13 13:10:59 UTC (rev 4450)
+++ branches/numpy.scons/numpy/f2py/lib/main.py	2007-11-13 13:51:35 UTC (rev 4451)
@@ -418,7 +418,7 @@
                                     '--build-clib',build_dir_clib_clib,
                                     ]
     temp_dirs = [build_dir_ext_temp, build_dir_clib_temp, build_dir_clib_clib]
-        
+
     if fc_flags:
         new_sys_argv += ['config_fc'] + fc_flags
     sys.argv[:] = new_sys_argv
@@ -492,7 +492,7 @@
     if source_ext is None:
         reader = get_reader(source)
         source_ext = {'free90':'.f90','fix90':'.f90','fix77':'.f','pyf':'.pyf'}[reader.mode]
-        
+
     if modulenames is None:
         modulenames = jobname,
     if os.path.isdir(tmpdir):

Modified: branches/numpy.scons/numpy/f2py/lib/parser/test_Fortran2003.py
===================================================================
--- branches/numpy.scons/numpy/f2py/lib/parser/test_Fortran2003.py	2007-11-13 13:10:59 UTC (rev 4450)
+++ branches/numpy.scons/numpy/f2py/lib/parser/test_Fortran2003.py	2007-11-13 13:51:35 UTC (rev 4451)
@@ -7,7 +7,7 @@
 ############################### SECTION  2 ####################################
 ###############################################################################
 
-class test_Program(NumpyTestCase): # R201
+class TestProgram(NumpyTestCase): # R201
 
     def check_simple(self):
         reader = get_reader('''\
@@ -21,7 +21,7 @@
         assert isinstance(a, cls),`a`
         assert_equal(str(a), 'SUBROUTINE foo\nEND SUBROUTINE foo\nSUBROUTINE bar\nEND SUBROUTINE bar')
 
-class test_Specification_Part(NumpyTestCase): # R204
+class TestSpecificationPart(NumpyTestCase): # R204
 
     def check_simple(self):
         from api import get_reader
@@ -37,7 +37,7 @@
 ############################### SECTION  3 ####################################
 ###############################################################################
 
-class test_Name(NumpyTestCase): # R304
+class TestName(NumpyTestCase): # R304
 
     def check_name(self):
         a = Name('a')
@@ -55,7 +55,7 @@
 ############################### SECTION  4 ####################################
 ###############################################################################
 
-class test_Type_Param_Value(NumpyTestCase): # 402
+class TestTypeParamValue(NumpyTestCase): # 402
 
     def check_type_param_value(self):
         cls = Type_Param_Value
@@ -72,7 +72,7 @@
         assert isinstance(a,Level_2_Expr),`a`
         assert_equal(str(a),'1 + 2')
 
-class test_Intrinsic_Type_Spec(NumpyTestCase): # R403
+class TestIntrinsicTypeSpec(NumpyTestCase): # R403
 
     def check_intrinsic_type_spec(self):
         cls = Intrinsic_Type_Spec
@@ -109,7 +109,7 @@
         assert isinstance(a,cls),`a`
         assert_equal(str(a),'DOUBLE PRECISION')
 
-class test_Kind_Selector(NumpyTestCase): # R404
+class TestKindSelector(NumpyTestCase): # R404
 
     def check_kind_selector(self):
         cls = Kind_Selector
@@ -126,7 +126,7 @@
         assert isinstance(a,cls),`a`
         assert_equal(str(a),'*1')
 
-class test_Signed_Int_Literal_Constant(NumpyTestCase): # R405
+class TestSignedIntLiteralConstant(NumpyTestCase): # R405
 
     def check_int_literal_constant(self):
         cls = Signed_Int_Literal_Constant
@@ -152,7 +152,7 @@
         assert isinstance(a,cls),`a`
         assert_equal(str(a),'+1976354279568241_8')
 
-class test_Int_Literal_Constant(NumpyTestCase): # R406
+class TestIntLiteralConstant(NumpyTestCase): # R406
 
     def check_int_literal_constant(self):
         cls = Int_Literal_Constant
@@ -178,7 +178,7 @@
         assert isinstance(a,cls),`a`
         assert_equal(str(a),'1976354279568241_8')
 
-class test_Binary_Constant(NumpyTestCase): # R412
+class TestBinaryConstant(NumpyTestCase): # R412
 
     def check_boz_literal_constant(self):
         cls = Boz_Literal_Constant
@@ -188,7 +188,7 @@
         assert_equal(str(a),'B"01"')
         assert_equal(repr(a),"%s('B\"01\"')" % (bcls.__name__))
 
-class test_Octal_Constant(NumpyTestCase): # R413
+class TestOctalConstant(NumpyTestCase): # R413
 
     def check_boz_literal_constant(self):
         cls = Boz_Literal_Constant
@@ -198,7 +198,7 @@
         assert_equal(str(a),'O"017"')
         assert_equal(repr(a),"%s('O\"017\"')" % (ocls.__name__))
 
-class test_Hex_Constant(NumpyTestCase): # R414
+class TestHexConstant(NumpyTestCase): # R414
 
     def check_boz_literal_constant(self):
         cls = Boz_Literal_Constant
@@ -208,7 +208,7 @@
         assert_equal(str(a),'Z"01A"')
         assert_equal(repr(a),"%s('Z\"01A\"')" % (zcls.__name__))
 
-class test_Signed_Real_Literal_Constant(NumpyTestCase): # R416
+class TestSignedRealLiteralConstant(NumpyTestCase): # R416
 
     def check_signed_real_literal_constant(self):
         cls = Signed_Real_Literal_Constant
@@ -265,7 +265,7 @@
         assert isinstance(a,cls),`a`
         assert_equal(str(a),'-10.9E-17_quad')
 
-class test_Real_Literal_Constant(NumpyTestCase): # R417
+class TestRealLiteralConstant(NumpyTestCase): # R417
 
     def check_real_literal_constant(self):
         cls = Real_Literal_Constant
@@ -326,7 +326,7 @@
         assert isinstance(a,cls),`a`
         assert_equal(str(a),'0.0D+0')
 
-class test_Char_Selector(NumpyTestCase): # R424
+class TestCharSelector(NumpyTestCase): # R424
 
     def check_char_selector(self):
         cls = Char_Selector
@@ -352,7 +352,7 @@
         assert isinstance(a,cls),`a`
         assert_equal(str(a),'(LEN = 2, KIND = 8)')
 
-class test_Complex_Literal_Constant(NumpyTestCase): # R421
+class TestComplexLiteralConstant(NumpyTestCase): # R421
 
     def check_complex_literal_constant(self):
         cls = Complex_Literal_Constant
@@ -374,7 +374,7 @@
         assert_equal(str(a),'(0., PI)')
 
 
-class test_Type_Name(NumpyTestCase): # C424
+class TestTypeName(NumpyTestCase): # C424
 
     def check_simple(self):
         cls = Type_Name
@@ -386,7 +386,7 @@
         self.assertRaises(NoMatchError,cls,'integer')
         self.assertRaises(NoMatchError,cls,'doubleprecision')
 
-class test_Length_Selector(NumpyTestCase): # R425
+class TestLengthSelector(NumpyTestCase): # R425
 
     def check_length_selector(self):
         cls = Length_Selector
@@ -399,7 +399,7 @@
         assert isinstance(a,cls),`a`
         assert_equal(str(a),'*2')
 
-class test_Char_Length(NumpyTestCase): # R426
+class TestCharLength(NumpyTestCase): # R426
 
     def check_char_length(self):
         cls = Char_Length
@@ -420,7 +420,7 @@
         assert isinstance(a,cls),`a`
         assert_equal(str(a),'(:)')
 
-class test_Char_Literal_Constant(NumpyTestCase): # R427
+class TestCharLiteralConstant(NumpyTestCase): # R427
 
     def check_char_literal_constant(self):
         cls = Char_Literal_Constant
@@ -454,7 +454,7 @@
         assert isinstance(a,cls),`a`
         assert_equal(str(a),'"hey ha(ada)\t"')
 
-class test_Logical_Literal_Constant(NumpyTestCase): # R428
+class TestLogicalLiteralConstant(NumpyTestCase): # R428
 
     def check_logical_literal_constant(self):
         cls = Logical_Literal_Constant
@@ -475,7 +475,7 @@
         assert isinstance(a,cls),`a`
         assert_equal(str(a),'.TRUE._HA')
 
-class test_Derived_Type_Stmt(NumpyTestCase): # R430
+class TestDerivedTypeStmt(NumpyTestCase): # R430
 
     def check_simple(self):
         cls = Derived_Type_Stmt
@@ -492,7 +492,7 @@
         assert isinstance(a, cls),`a`
         assert_equal(str(a),'TYPE, PRIVATE, ABSTRACT :: a(b, c)')
 
-class test_Type_Name(NumpyTestCase): # C423
+class TestTypeName(NumpyTestCase): # C423
 
     def check_simple(self):
         cls = Type_Name
@@ -501,7 +501,7 @@
         assert_equal(str(a),'a')
         assert_equal(repr(a),"Type_Name('a')")
 
-class test_Type_Attr_Spec(NumpyTestCase): # R431
+class TestTypeAttrSpec(NumpyTestCase): # R431
 
     def check_simple(self):
         cls = Type_Attr_Spec
@@ -523,7 +523,7 @@
         assert_equal(str(a),'PRIVATE')
 
 
-class test_End_Type_Stmt(NumpyTestCase): # R433
+class TestEndTypeStmt(NumpyTestCase): # R433
 
     def check_simple(self):
         cls = End_Type_Stmt
@@ -536,7 +536,7 @@
         assert isinstance(a, cls),`a`
         assert_equal(str(a),'END TYPE a')
 
-class test_Sequence_Stmt(NumpyTestCase): # R434
+class TestSequenceStmt(NumpyTestCase): # R434
 
     def check_simple(self):
         cls = Sequence_Stmt
@@ -545,7 +545,7 @@
         assert_equal(str(a),'SEQUENCE')
         assert_equal(repr(a),"Sequence_Stmt('SEQUENCE')")
 
-class test_Type_Param_Def_Stmt(NumpyTestCase): # R435
+class TestTypeParamDefStmt(NumpyTestCase): # R435
 
     def check_simple(self):
         cls = Type_Param_Def_Stmt
@@ -558,7 +558,7 @@
         assert isinstance(a, cls),`a`
         assert_equal(str(a),'INTEGER*2, LEN :: a = 3, b = 2 + c')
 
-class test_Type_Param_Decl(NumpyTestCase): # R436
+class TestTypeParamDecl(NumpyTestCase): # R436
 
     def check_simple(self):
         cls = Type_Param_Decl
@@ -571,7 +571,7 @@
         assert isinstance(a, Name),`a`
         assert_equal(str(a),'a')
 
-class test_Type_Param_Attr_Spec(NumpyTestCase): # R437
+class TestTypeParamAttrSpec(NumpyTestCase): # R437
 
     def check_simple(self):
         cls = Type_Param_Attr_Spec
@@ -584,7 +584,7 @@
         assert isinstance(a, cls),`a`
         assert_equal(str(a),'LEN')
 
-class test_Component_Attr_Spec(NumpyTestCase): # R441
+class TestComponentAttrSpec(NumpyTestCase): # R441
 
     def check_simple(self):
         cls = Component_Attr_Spec
@@ -605,7 +605,7 @@
         assert isinstance(a, Access_Spec),`a`
         assert_equal(str(a),'PRIVATE')
 
-class test_Component_Decl(NumpyTestCase): # R442
+class TestComponentDecl(NumpyTestCase): # R442
 
     def check_simple(self):
         cls = Component_Decl
@@ -626,7 +626,7 @@
         assert isinstance(a, cls),`a`
         assert_equal(str(a),'a(1) => NULL')
 
-class test_Final_Binding(NumpyTestCase): # R454
+class TestFinalBinding(NumpyTestCase): # R454
 
     def check_simple(self):
         cls = Final_Binding
@@ -639,7 +639,7 @@
         assert isinstance(a,cls),`a`
         assert_equal(str(a),'FINAL :: a')
 
-class test_Derived_Type_Spec(NumpyTestCase): # R455
+class TestDerivedTypeSpec(NumpyTestCase): # R455
 
     def check_simple(self):
         cls = Derived_Type_Spec
@@ -660,7 +660,7 @@
         assert isinstance(a,cls),`a`
         assert_equal(str(a),'a()')
 
-class test_Type_Param_Spec(NumpyTestCase): # R456
+class TestTypeParamSpec(NumpyTestCase): # R456
 
     def check_type_param_spec(self):
         cls = Type_Param_Spec
@@ -677,7 +677,7 @@
         assert isinstance(a,cls),`a`
         assert_equal(str(a),'k = :')
 
-class test_Type_Param_Spec_List(NumpyTestCase): # R456-list
+class TestTypeParamSpecList(NumpyTestCase): # R456-list
 
     def check_type_param_spec_list(self):
         cls = Type_Param_Spec_List
@@ -694,7 +694,7 @@
         assert isinstance(a,cls),`a`
         assert_equal(str(a),'k = a, c, g = 1')
 
-class test_Structure_Constructor_2(NumpyTestCase): # R457.b
+class TestStructureConstructor2(NumpyTestCase): # R457.b
 
     def check_simple(self):
         cls = Structure_Constructor_2
@@ -707,7 +707,7 @@
         assert isinstance(a,Name),`a`
         assert_equal(str(a),'a')
 
-class test_Structure_Constructor(NumpyTestCase): # R457
+class TestStructureConstructor(NumpyTestCase): # R457
 
     def check_structure_constructor(self):
         cls = Structure_Constructor
@@ -729,7 +729,7 @@
         assert isinstance(a,Name),`a`
         assert_equal(str(a),'a')
 
-class test_Component_Spec(NumpyTestCase): # R458
+class TestComponentSpec(NumpyTestCase): # R458
 
     def check_simple(self):
         cls = Component_Spec
@@ -750,7 +750,7 @@
         assert isinstance(a, Component_Spec),`a`
         assert_equal(str(a),'s = a % b')
 
-class test_Component_Spec_List(NumpyTestCase): # R458-list
+class TestComponentSpecList(NumpyTestCase): # R458-list
 
     def check_simple(self):
         cls = Component_Spec_List
@@ -763,7 +763,7 @@
         assert isinstance(a,cls),`a`
         assert_equal(str(a),'k = a, c')
 
-class test_Array_Constructor(NumpyTestCase): # R465
+class TestArrayConstructor(NumpyTestCase): # R465
 
     def check_simple(self):
         cls = Array_Constructor
@@ -785,7 +785,7 @@
         assert isinstance(a,cls),`a`
         assert_equal(str(a),'[INTEGER :: a, b]')
 
-class test_Ac_Spec(NumpyTestCase): # R466
+class TestAcSpec(NumpyTestCase): # R466
 
     def check_ac_spec(self):
         cls = Ac_Spec
@@ -806,7 +806,7 @@
         assert isinstance(a,cls),`a`
         assert_equal(str(a),'INTEGER :: a, (a, b, n = 1, 5)')
 
-class test_Ac_Value_List(NumpyTestCase): # R469-list
+class TestAcValueList(NumpyTestCase): # R469-list
 
     def check_ac_value_list(self):
         cls = Ac_Value_List
@@ -819,7 +819,7 @@
         assert isinstance(a,Name),`a`
         assert_equal(str(a),'a')
 
-class test_Ac_Implied_Do(NumpyTestCase): # R470
+class TestAcImpliedDo(NumpyTestCase): # R470
 
     def check_ac_implied_do(self):
         cls = Ac_Implied_Do
@@ -828,7 +828,7 @@
         assert_equal(str(a),'(a, b, n = 1, 5)')
         assert_equal(repr(a),"Ac_Implied_Do(Ac_Value_List(',', (Name('a'), Name('b'))), Ac_Implied_Do_Control(Name('n'), [Int_Literal_Constant('1', None), Int_Literal_Constant('5', None)]))")
 
-class test_Ac_Implied_Do_Control(NumpyTestCase): # R471
+class TestAcImpliedDoControl(NumpyTestCase): # R471
 
     def check_ac_implied_do_control(self):
         cls = Ac_Implied_Do_Control
@@ -845,7 +845,7 @@
 ############################### SECTION  5 ####################################
 ###############################################################################
 
-class test_Type_Declaration_Stmt(NumpyTestCase): # R501
+class TestTypeDeclarationStmt(NumpyTestCase): # R501
 
     def check_simple(self):
         cls = Type_Declaration_Stmt
@@ -869,7 +869,7 @@
         a = cls('DOUBLE PRECISION   ALPHA, BETA')
         assert isinstance(a, cls),`a`
 
-class test_Declaration_Type_Spec(NumpyTestCase): # R502
+class TestDeclarationTypeSpec(NumpyTestCase): # R502
 
     def check_simple(self):
         cls = Declaration_Type_Spec
@@ -882,7 +882,7 @@
         assert_equal(str(a), 'TYPE(foo)')
         assert_equal(repr(a), "Declaration_Type_Spec('TYPE', Type_Name('foo'))")
 
-class test_Attr_Spec(NumpyTestCase): # R503
+class TestAttrSpec(NumpyTestCase): # R503
 
     def check_simple(self):
         cls = Attr_Spec
@@ -894,7 +894,7 @@
         assert isinstance(a, Dimension_Attr_Spec),`a`
         assert_equal(str(a),'DIMENSION(a)')
 
-class test_Dimension_Attr_Spec(NumpyTestCase): # R503.d
+class TestDimensionAttrSpec(NumpyTestCase): # R503.d
 
     def check_simple(self):
         cls = Dimension_Attr_Spec
@@ -903,7 +903,7 @@
         assert_equal(str(a),'DIMENSION(a)')
         assert_equal(repr(a),"Dimension_Attr_Spec('DIMENSION', Explicit_Shape_Spec(None, Name('a')))")
 
-class test_Intent_Attr_Spec(NumpyTestCase): # R503.f
+class TestIntentAttrSpec(NumpyTestCase): # R503.f
 
     def check_simple(self):
         cls = Intent_Attr_Spec
@@ -912,7 +912,7 @@
         assert_equal(str(a),'INTENT(IN)')
         assert_equal(repr(a),"Intent_Attr_Spec('INTENT', Intent_Spec('IN'))")
 
-class test_Entity_Decl(NumpyTestCase): # 504
+class TestEntityDecl(NumpyTestCase): # 504
 
     def check_simple(self):
         cls = Entity_Decl
@@ -929,7 +929,7 @@
         assert isinstance(a, cls),`a`
         assert_equal(str(a),'a(1)*(3) = 2')
 
-class test_Access_Spec(NumpyTestCase): # R508
+class TestAccessSpec(NumpyTestCase): # R508
 
     def check_simple(self):
         cls = Access_Spec
@@ -942,7 +942,7 @@
         assert isinstance(a, cls),`a`
         assert_equal(str(a),'PUBLIC')
 
-class test_Language_Binding_Spec(NumpyTestCase): # R509
+class TestLanguageBindingSpec(NumpyTestCase): # R509
 
     def check_simple(self):
         cls = Language_Binding_Spec
@@ -955,7 +955,7 @@
         assert isinstance(a, cls),`a`
         assert_equal(str(a),'BIND(C, NAME = "hey")')
 
-class test_Explicit_Shape_Spec(NumpyTestCase): # R511
+class TestExplicitShapeSpec(NumpyTestCase): # R511
 
     def check_simple(self):
         cls = Explicit_Shape_Spec
@@ -968,7 +968,7 @@
         assert isinstance(a, cls),`a`
         assert_equal(str(a),'a')
 
-class test_Upper_Bound(NumpyTestCase): # R513
+class TestUpperBound(NumpyTestCase): # R513
 
     def check_simple(self):
         cls = Upper_Bound
@@ -978,7 +978,7 @@
 
         self.assertRaises(NoMatchError,cls,'*')
 
-class test_Assumed_Shape_Spec(NumpyTestCase): # R514
+class TestAssumedShapeSpec(NumpyTestCase): # R514
 
     def check_simple(self):
         cls = Assumed_Shape_Spec
@@ -991,7 +991,7 @@
         assert isinstance(a, cls),`a`
         assert_equal(str(a),'a :')
 
-class test_Deferred_Shape_Spec(NumpyTestCase): # R515
+class TestDeferredShapeSpec(NumpyTestCase): # R515
 
     def check_simple(self):
         cls = Deferred_Shape_Spec
@@ -1001,7 +1001,7 @@
         assert_equal(repr(a),'Deferred_Shape_Spec(None, None)')
 
 
-class test_Assumed_Size_Spec(NumpyTestCase): # R516
+class TestAssumedSizeSpec(NumpyTestCase): # R516
 
     def check_simple(self):
         cls = Assumed_Size_Spec
@@ -1022,7 +1022,7 @@
         assert isinstance(a, cls),`a`
         assert_equal(str(a),'a : b, 1 : *')
 
-class test_Access_Stmt(NumpyTestCase): # R518
+class TestAccessStmt(NumpyTestCase): # R518
 
     def check_simple(self):
         cls = Access_Stmt
@@ -1039,7 +1039,7 @@
         assert isinstance(a, cls),`a`
         assert_equal(str(a),'PUBLIC :: a')
 
-class test_Parameter_Stmt(NumpyTestCase): # R538
+class TestParameterStmt(NumpyTestCase): # R538
 
     def check_simple(self):
         cls = Parameter_Stmt
@@ -1056,7 +1056,7 @@
         assert isinstance(a, cls),`a`
         assert_equal(str(a),'PARAMETER(ONE = 1.0D+0, ZERO = 0.0D+0)')
 
-class test_Named_Constant_Def(NumpyTestCase): # R539
+class TestNamedConstantDef(NumpyTestCase): # R539
 
     def check_simple(self):
         cls = Named_Constant_Def
@@ -1065,7 +1065,7 @@
         assert_equal(str(a),'a = 1')
         assert_equal(repr(a),"Named_Constant_Def(Name('a'), Int_Literal_Constant('1', None))")
 
-class test_Pointer_Decl(NumpyTestCase): # R541
+class TestPointerDecl(NumpyTestCase): # R541
 
     def check_simple(self):
         cls = Pointer_Decl
@@ -1078,7 +1078,7 @@
         assert isinstance(a, cls),`a`
         assert_equal(str(a),'a(:, :)')
 
-class test_Implicit_Stmt(NumpyTestCase): # R549
+class TestImplicitStmt(NumpyTestCase): # R549
 
     def check_simple(self):
         cls = Implicit_Stmt
@@ -1091,7 +1091,7 @@
         assert isinstance(a, cls),`a`
         assert_equal(str(a),'IMPLICIT REAL(A - D), DOUBLE PRECISION(R - T, X), TYPE(a)(Y - Z)')
 
-class test_Implicit_Spec(NumpyTestCase): # R550
+class TestImplicitSpec(NumpyTestCase): # R550
 
     def check_simple(self):
         cls = Implicit_Spec
@@ -1104,7 +1104,7 @@
         assert isinstance(a, cls),`a`
         assert_equal(str(a),'DOUBLE COMPLEX(R, D - G)')
 
-class test_Letter_Spec(NumpyTestCase): # R551
+class TestLetterSpec(NumpyTestCase): # R551
 
     def check_simple(self):
         cls = Letter_Spec
@@ -1117,7 +1117,7 @@
         assert isinstance(a, cls),`a`
         assert_equal(str(a),'D')
 
-class test_Equivalence_Stmt(NumpyTestCase): # R554
+class TestEquivalenceStmt(NumpyTestCase): # R554
 
     def check_simple(self):
         cls = Equivalence_Stmt
@@ -1130,7 +1130,7 @@
         assert isinstance(a, cls),`a`
         assert_equal(str(a),'EQUIVALENCE(a, b, z), (b, l)')
 
-class test_Common_Stmt(NumpyTestCase): # R557
+class TestCommonStmt(NumpyTestCase): # R557
 
     def check_simple(self):
         cls = Common_Stmt
@@ -1151,7 +1151,7 @@
         assert isinstance(a, cls),`a`
         assert_equal(str(a),'COMMON /name/ a, b(4, 5) // c /ljuks/ g(2)')
 
-class test_Common_Block_Object(NumpyTestCase): # R558
+class TestCommonBlockObject(NumpyTestCase): # R558
 
     def check_simple(self):
         cls = Common_Block_Object
@@ -1169,7 +1169,7 @@
 ############################### SECTION  6 ####################################
 ###############################################################################
 
-class test_Substring(NumpyTestCase): # R609
+class TestSubstring(NumpyTestCase): # R609
 
     def check_simple(self):
         cls = Substring
@@ -1184,7 +1184,7 @@
         assert_equal(repr(a),"Substring(Name('a'), Substring_Range(Int_Literal_Constant('1', None), Int_Literal_Constant('2', None)))")
 
 
-class test_Substring_Range(NumpyTestCase): # R611
+class TestSubstringRange(NumpyTestCase): # R611
 
     def check_simple(self):
         cls = Substring_Range
@@ -1215,7 +1215,7 @@
         assert_equal(str(a),': b')
 
 
-class test_Data_Ref(NumpyTestCase): # R612
+class TestDataRef(NumpyTestCase): # R612
 
     def check_data_ref(self):
         cls = Data_Ref
@@ -1228,7 +1228,7 @@
         assert isinstance(a,Name),`a`
         assert_equal(str(a),'a')
 
-class test_Part_Ref(NumpyTestCase): # R613
+class TestPartRef(NumpyTestCase): # R613
 
     def check_part_ref(self):
         cls = Part_Ref
@@ -1236,7 +1236,7 @@
         assert isinstance(a, Name),`a`
         assert_equal(str(a),'a')
 
-class test_Type_Param_Inquiry(NumpyTestCase): # R615
+class TestTypeParamInquiry(NumpyTestCase): # R615
 
     def check_simple(self):
         cls = Type_Param_Inquiry
@@ -1246,7 +1246,7 @@
         assert_equal(repr(a),"Type_Param_Inquiry(Name('a'), '%', Name('b'))")
 
 
-class test_Array_Section(NumpyTestCase): # R617
+class TestArraySection(NumpyTestCase): # R617
 
     def check_array_section(self):
         cls = Array_Section
@@ -1260,7 +1260,7 @@
         assert_equal(str(a),'a(2 :)')
 
 
-class test_Section_Subscript(NumpyTestCase): # R619
+class TestSectionSubscript(NumpyTestCase): # R619
 
     def check_simple(self):
         cls = Section_Subscript
@@ -1273,7 +1273,7 @@
         assert isinstance(a, Name),`a`
         assert_equal(str(a),'zzz')
 
-class test_Section_Subscript_List(NumpyTestCase): # R619-list
+class TestSectionSubscriptList(NumpyTestCase): # R619-list
 
     def check_simple(self):
         cls = Section_Subscript_List
@@ -1290,7 +1290,7 @@
         assert isinstance(a,cls),`a`
         assert_equal(str(a),': : 1, 3')
 
-class test_Subscript_Triplet(NumpyTestCase): # R620
+class TestSubscriptTriplet(NumpyTestCase): # R620
 
     def check_simple(self):
         cls = Subscript_Triplet
@@ -1319,7 +1319,7 @@
         assert isinstance(a,cls),`a`
         assert_equal(str(a),'a + 1 :')
 
-class test_Alloc_Opt(NumpyTestCase): # R624
+class TestAllocOpt(NumpyTestCase): # R624
 
     def check_simple(self):
         cls = Alloc_Opt
@@ -1328,7 +1328,7 @@
         assert_equal(str(a),'STAT = a')
         assert_equal(repr(a),"Alloc_Opt('STAT', Name('a'))")
 
-class test_Nullify_Stmt(NumpyTestCase): # R633
+class TestNullifyStmt(NumpyTestCase): # R633
 
     def check_simple(self):
         cls = Nullify_Stmt
@@ -1345,7 +1345,7 @@
 ############################### SECTION  7 ####################################
 ###############################################################################
 
-class test_Primary(NumpyTestCase): # R701
+class TestPrimary(NumpyTestCase): # R701
 
     def check_simple(self):
         cls = Primary
@@ -1401,7 +1401,7 @@
         assert isinstance(a,Real_Literal_Constant),`a`
         assert_equal(str(a),'0.0E-1')
 
-class test_Parenthesis(NumpyTestCase): # R701.h
+class TestParenthesis(NumpyTestCase): # R701.h
 
     def check_simple(self):
         cls = Parenthesis
@@ -1422,7 +1422,7 @@
         assert isinstance(a,cls),`a`
         assert_equal(str(a),'(a + (a + c))')
 
-class test_Level_1_Expr(NumpyTestCase): # R702
+class TestLevel1Expr(NumpyTestCase): # R702
 
     def check_simple(self):
         cls = Level_1_Expr
@@ -1433,7 +1433,7 @@
 
         self.assertRaises(NoMatchError,cls,'.not. a')
 
-class test_Mult_Operand(NumpyTestCase): # R704
+class TestMultOperand(NumpyTestCase): # R704
 
     def check_simple(self):
         cls = Mult_Operand
@@ -1454,7 +1454,7 @@
         assert isinstance(a,Real_Literal_Constant),`a`
         assert_equal(str(a),'0.0E-1')
 
-class test_Add_Operand(NumpyTestCase): # R705
+class TestAddOperand(NumpyTestCase): # R705
 
     def check_simple(self):
         cls = Add_Operand
@@ -1475,7 +1475,7 @@
         assert isinstance(a,Real_Literal_Constant),`a`
         assert_equal(str(a),'0.0E-1')
 
-class test_Level_2_Expr(NumpyTestCase): # R706
+class TestLevel2Expr(NumpyTestCase): # R706
 
     def check_simple(self):
         cls = Level_2_Expr
@@ -1509,7 +1509,7 @@
         assert_equal(str(a),'0.0E-1')
 
 
-class test_Level_2_Unary_Expr(NumpyTestCase):
+class TestLevel2UnaryExpr(NumpyTestCase):
 
     def check_simple(self):
         cls = Level_2_Unary_Expr
@@ -1531,7 +1531,7 @@
         assert_equal(str(a),'0.0E-1')
 
 
-class test_Level_3_Expr(NumpyTestCase): # R710
+class TestLevel3Expr(NumpyTestCase): # R710
 
     def check_simple(self):
         cls = Level_3_Expr
@@ -1544,7 +1544,7 @@
         assert isinstance(a,cls),`a`
         assert_equal(str(a),'"a" // "b"')
 
-class test_Level_4_Expr(NumpyTestCase): # R712
+class TestLevel4Expr(NumpyTestCase): # R712
 
     def check_simple(self):
         cls = Level_4_Expr
@@ -1593,7 +1593,7 @@
         assert isinstance(a,cls),`a`
         assert_equal(str(a),'a > b')
 
-class test_And_Operand(NumpyTestCase): # R714
+class TestAndOperand(NumpyTestCase): # R714
 
     def check_simple(self):
         cls = And_Operand
@@ -1602,7 +1602,7 @@
         assert_equal(str(a),'.NOT. a')
         assert_equal(repr(a),"And_Operand('.NOT.', Name('a'))")
 
-class test_Or_Operand(NumpyTestCase): # R715
+class TestOrOperand(NumpyTestCase): # R715
 
     def check_simple(self):
         cls = Or_Operand
@@ -1612,7 +1612,7 @@
         assert_equal(repr(a),"Or_Operand(Name('a'), '.AND.', Name('b'))")
 
 
-class test_Equiv_Operand(NumpyTestCase): # R716
+class TestEquivOperand(NumpyTestCase): # R716
 
     def check_simple(self):
         cls = Equiv_Operand
@@ -1622,7 +1622,7 @@
         assert_equal(repr(a),"Equiv_Operand(Name('a'), '.OR.', Name('b'))")
 
 
-class test_Level_5_Expr(NumpyTestCase): # R717
+class TestLevel5Expr(NumpyTestCase): # R717
 
     def check_simple(self):
         cls = Level_5_Expr
@@ -1639,7 +1639,7 @@
         assert isinstance(a,Level_4_Expr),`a`
         assert_equal(str(a),'a .EQ. b')
 
-class test_Expr(NumpyTestCase): # R722
+class TestExpr(NumpyTestCase): # R722
 
     def check_simple(self):
         cls = Expr
@@ -1661,7 +1661,7 @@
 
         self.assertRaises(NoMatchError,Scalar_Int_Expr,'a,b')
 
-class test_Assignment_Stmt(NumpyTestCase): # R734
+class TestAssignmentStmt(NumpyTestCase): # R734
 
     def check_simple(self):
         cls = Assignment_Stmt
@@ -1678,7 +1678,7 @@
         assert isinstance(a, cls),`a`
         assert_equal(str(a),'a % c = b + c')
 
-class test_Proc_Component_Ref(NumpyTestCase): # R741
+class TestProcComponentRef(NumpyTestCase): # R741
 
     def check_proc_component_ref(self):
         cls = Proc_Component_Ref
@@ -1687,7 +1687,7 @@
         assert_equal(str(a),'a % b')
         assert_equal(repr(a),"Proc_Component_Ref(Name('a'), '%', Name('b'))")
 
-class test_Where_Stmt(NumpyTestCase): # R743
+class TestWhereStmt(NumpyTestCase): # R743
 
     def check_simple(self):
         cls = Where_Stmt
@@ -1696,7 +1696,7 @@
         assert_equal(str(a),'WHERE (a) c = 2')
         assert_equal(repr(a),"Where_Stmt(Name('a'), Assignment_Stmt(Name('c'), '=', Int_Literal_Constant('2', None)))")
 
-class test_Where_Construct_Stmt(NumpyTestCase): # R745
+class TestWhereConstructStmt(NumpyTestCase): # R745
 
     def check_simple(self):
         cls = Where_Construct_Stmt
@@ -1710,7 +1710,7 @@
 ############################### SECTION  8 ####################################
 ###############################################################################
 
-class test_Continue_Stmt(NumpyTestCase): # R848
+class TestContinueStmt(NumpyTestCase): # R848
 
     def check_simple(self):
         cls = Continue_Stmt
@@ -1723,7 +1723,7 @@
 ############################### SECTION  9 ####################################
 ###############################################################################
 
-class test_Io_Unit(NumpyTestCase): # R901
+class TestIoUnit(NumpyTestCase): # R901
 
     def check_simple(self):
         cls = Io_Unit
@@ -1735,7 +1735,7 @@
         assert isinstance(a, Name),`a`
         assert_equal(str(a),'a')
 
-class test_Write_Stmt(NumpyTestCase): # R911
+class TestWriteStmt(NumpyTestCase): # R911
 
     def check_simple(self):
         cls = Write_Stmt
@@ -1744,7 +1744,7 @@
         assert_equal(str(a),'WRITE(UNIT = 123) "hey"')
         assert_equal(repr(a),'Write_Stmt(Io_Control_Spec_List(\',\', (Io_Control_Spec(\'UNIT\', Int_Literal_Constant(\'123\', None)),)), Char_Literal_Constant(\'"hey"\', None))')
 
-class test_Print_Stmt(NumpyTestCase): # R912
+class TestPrintStmt(NumpyTestCase): # R912
 
     def check_simple(self):
         cls = Print_Stmt
@@ -1757,7 +1757,7 @@
         assert isinstance(a, cls),`a`
         assert_equal(str(a),'PRINT *, "a=", a')
 
-class test_Io_Control_Spec(NumpyTestCase): # R913
+class TestIoControlSpec(NumpyTestCase): # R913
 
     def check_simple(self):
         cls = Io_Control_Spec
@@ -1766,7 +1766,7 @@
         assert_equal(str(a),'END = 123')
         assert_equal(repr(a),"Io_Control_Spec('END', Label('123'))")
 
-class test_Io_Control_Spec_List(NumpyTestCase): # R913-list
+class TestIoControlSpecList(NumpyTestCase): # R913-list
 
     def check_simple(self):
         cls = Io_Control_Spec_List
@@ -1793,7 +1793,7 @@
             assert isinstance(a, cls),`a`
             assert_equal(str(a),'UNIT = 123, NML = a')
 
-class test_Format(NumpyTestCase): # R914
+class TestFormat(NumpyTestCase): # R914
 
     def check_simple(self):
         cls = Format
@@ -1810,7 +1810,7 @@
         assert isinstance(a, Label),`a`
         assert_equal(str(a),'123')
 
-class test_Wait_Stmt(NumpyTestCase): # R921
+class TestWaitStmt(NumpyTestCase): # R921
 
     def check_simple(self):
         cls = Wait_Stmt
@@ -1818,7 +1818,7 @@
         assert isinstance(a, cls),`a`
         assert_equal(str(a),'WAIT(UNIT = 123)')
 
-class test_Wait_Spec(NumpyTestCase): # R922
+class TestWaitSpec(NumpyTestCase): # R922
 
     def check_simple(self):
         cls = Wait_Spec
@@ -1840,7 +1840,7 @@
 ############################### SECTION 11 ####################################
 ###############################################################################
 
-class test_Use_Stmt(NumpyTestCase): # R1109
+class TestUseStmt(NumpyTestCase): # R1109
 
     def check_simple(self):
         cls = Use_Stmt
@@ -1861,7 +1861,7 @@
         assert isinstance(a, cls),`a`
         assert_equal(str(a),'USE, INTRINSIC :: a, OPERATOR(.HEY.) => OPERATOR(.HOO.), c => g')
 
-class test_Module_Nature(NumpyTestCase): # R1110
+class TestModuleNature(NumpyTestCase): # R1110
 
     def check_simple(self):
         cls = Module_Nature
@@ -1878,7 +1878,7 @@
 ############################### SECTION 12 ####################################
 ###############################################################################
 
-class test_Function_Reference(NumpyTestCase): # R1217
+class TestFunctionReference(NumpyTestCase): # R1217
 
     def check_simple(self):
         cls = Function_Reference
@@ -1892,7 +1892,7 @@
         assert_equal(str(a),'f(2, k = 1, a)')
 
 
-class test_Procedure_Designator(NumpyTestCase): # R1219
+class TestProcedureDesignator(NumpyTestCase): # R1219
 
     def check_procedure_designator(self):
         cls = Procedure_Designator
@@ -1901,7 +1901,7 @@
         assert_equal(str(a),'a % b')
         assert_equal(repr(a),"Procedure_Designator(Name('a'), '%', Name('b'))")
 
-class test_Actual_Arg_Spec(NumpyTestCase): # R1220
+class TestActualArgSpec(NumpyTestCase): # R1220
 
     def check_simple(self):
         cls = Actual_Arg_Spec
@@ -1914,7 +1914,7 @@
         assert isinstance(a,Name),`a`
         assert_equal(str(a),'a')
 
-class test_Actual_Arg_Spec_List(NumpyTestCase):
+class TestActualArgSpecList(NumpyTestCase):
 
     def check_simple(self):
         cls = Actual_Arg_Spec_List
@@ -1935,7 +1935,7 @@
         assert isinstance(a,Name),`a`
         assert_equal(str(a),'a')
 
-class test_Alt_Return_Spec(NumpyTestCase): # R1222
+class TestAltReturnSpec(NumpyTestCase): # R1222
 
     def check_alt_return_spec(self):
         cls = Alt_Return_Spec
@@ -1944,7 +1944,7 @@
         assert_equal(str(a),'*123')
         assert_equal(repr(a),"Alt_Return_Spec(Label('123'))")
 
-class test_Prefix(NumpyTestCase): # R1227
+class TestPrefix(NumpyTestCase): # R1227
 
     def check_simple(self):
         cls = Prefix
@@ -1957,7 +1957,7 @@
         assert isinstance(a, cls),`a`
         assert_equal(str(a),'INTEGER*2 PURE')
 
-class test_Prefix_Spec(NumpyTestCase): # R1228
+class TestPrefixSpec(NumpyTestCase): # R1228
 
     def check_simple(self):
         cls = Prefix_Spec
@@ -1978,7 +1978,7 @@
         assert isinstance(a, Intrinsic_Type_Spec),`a`
         assert_equal(str(a),'INTEGER*2')
 
-class test_Subroutine_Subprogram(NumpyTestCase): # R1231
+class TestSubroutineSubprogram(NumpyTestCase): # R1231
 
     def check_simple(self):
         from api import get_reader
@@ -2000,7 +2000,7 @@
         assert isinstance(a, cls),`a`
         assert_equal(str(a),'SUBROUTINE foo\n  INTEGER :: a\nEND SUBROUTINE foo')
 
-class test_Subroutine_Stmt(NumpyTestCase): # R1232
+class TestSubroutineStmt(NumpyTestCase): # R1232
 
     def check_simple(self):
         cls = Subroutine_Stmt
@@ -2021,7 +2021,7 @@
         assert isinstance(a, cls),`a`
         assert_equal(str(a),'SUBROUTINE foo BIND(C)')
 
-class test_End_Subroutine_Stmt(NumpyTestCase): # R1234
+class TestEndSubroutineStmt(NumpyTestCase): # R1234
 
     def check_simple(self):
         cls = End_Subroutine_Stmt
@@ -2038,7 +2038,7 @@
         assert isinstance(a, cls),`a`
         assert_equal(str(a),'END SUBROUTINE')
 
-class test_Return_Stmt(NumpyTestCase): # R1236
+class TestReturnStmt(NumpyTestCase): # R1236
 
     def check_simple(self):
         cls = Return_Stmt
@@ -2047,7 +2047,7 @@
         assert_equal(str(a), 'RETURN')
         assert_equal(repr(a), 'Return_Stmt(None)')
 
-class test_Contains(NumpyTestCase): # R1237
+class TestContains(NumpyTestCase): # R1237
 
     def check_simple(self):
         cls = Contains_Stmt

Modified: branches/numpy.scons/numpy/f2py/lib/parser/test_parser.py
===================================================================
--- branches/numpy.scons/numpy/f2py/lib/parser/test_parser.py	2007-11-13 13:10:59 UTC (rev 4450)
+++ branches/numpy.scons/numpy/f2py/lib/parser/test_parser.py	2007-11-13 13:51:35 UTC (rev 4451)
@@ -34,7 +34,7 @@
         return r
     raise ValueError, 'parsing %r with %s pattern failed' % (line, cls.__name__)
 
-class test_Statements(NumpyTestCase):
+class TestStatements(NumpyTestCase):
 
     def check_assignment(self):
         assert_equal(parse(Assignment,'a=b'), 'a = b')

Modified: branches/numpy.scons/numpy/f2py/lib/py_wrap_type.py
===================================================================
--- branches/numpy.scons/numpy/f2py/lib/py_wrap_type.py	2007-11-13 13:10:59 UTC (rev 4450)
+++ branches/numpy.scons/numpy/f2py/lib/py_wrap_type.py	2007-11-13 13:51:35 UTC (rev 4451)
@@ -453,12 +453,12 @@
     0,                         /*tp_as_buffer*/
     Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,        /*tp_flags*/
     "Fortran derived type %(name)s objects",        /* tp_doc */
-    0,		               /* tp_traverse */
-    0,		               /* tp_clear */
-    0,		               /* tp_richcompare */
-    0,		               /* tp_weaklistoffset */
-    0,		               /* tp_iter */
-    0,		               /* tp_iternext */
+    0,                         /* tp_traverse */
+    0,                         /* tp_clear */
+    0,                         /* tp_richcompare */
+    0,                         /* tp_weaklistoffset */
+    0,                         /* tp_iter */
+    0,                         /* tp_iternext */
     %(otype)s_methods,          /* tp_methods */
     0 /*%(otype)s_members*/,    /* tp_members */
     %(otype)s_getseters,       /* tp_getset */

Modified: branches/numpy.scons/numpy/f2py/lib/tests/test_derived_scalar.py
===================================================================
--- branches/numpy.scons/numpy/f2py/lib/tests/test_derived_scalar.py	2007-11-13 13:10:59 UTC (rev 4450)
+++ branches/numpy.scons/numpy/f2py/lib/tests/test_derived_scalar.py	2007-11-13 13:51:35 UTC (rev 4451)
@@ -42,7 +42,7 @@
 
 from numpy import *
 
-class test_m(NumpyTestCase):
+class TestM(NumpyTestCase):
 
     def check_foo_simple(self, level=1):
         a = m.myt(2)

Modified: branches/numpy.scons/numpy/f2py/lib/tests/test_module_module.py
===================================================================
--- branches/numpy.scons/numpy/f2py/lib/tests/test_module_module.py	2007-11-13 13:10:59 UTC (rev 4450)
+++ branches/numpy.scons/numpy/f2py/lib/tests/test_module_module.py	2007-11-13 13:51:35 UTC (rev 4451)
@@ -42,7 +42,7 @@
       type(rat) a
       print*,"In bar,a=",a
     end subroutine bar
-end module test_module_module_ext 
+end module test_module_module_ext
 '''
 
 m,m2 = compile(fortran_code, modulenames=['test_module_module_ext',
@@ -51,7 +51,7 @@
 
 from numpy import *
 
-class test_m(NumpyTestCase):
+class TestM(NumpyTestCase):
 
     def check_foo_simple(self, level=1):
         foo = m.foo

Modified: branches/numpy.scons/numpy/f2py/lib/tests/test_module_scalar.py
===================================================================
--- branches/numpy.scons/numpy/f2py/lib/tests/test_module_scalar.py	2007-11-13 13:10:59 UTC (rev 4450)
+++ branches/numpy.scons/numpy/f2py/lib/tests/test_module_scalar.py	2007-11-13 13:51:35 UTC (rev 4451)
@@ -40,7 +40,7 @@
 
 from numpy import *
 
-class test_m(NumpyTestCase):
+class TestM(NumpyTestCase):
 
     def check_foo_simple(self, level=1):
         foo = m.foo

Modified: branches/numpy.scons/numpy/f2py/lib/tests/test_scalar_function_in.py
===================================================================
--- branches/numpy.scons/numpy/f2py/lib/tests/test_scalar_function_in.py	2007-11-13 13:10:59 UTC (rev 4450)
+++ branches/numpy.scons/numpy/f2py/lib/tests/test_scalar_function_in.py	2007-11-13 13:51:35 UTC (rev 4451)
@@ -107,7 +107,7 @@
 
 from numpy import *
 
-class test_m(NumpyTestCase):
+class TestM(NumpyTestCase):
 
     def check_foo_integer1(self, level=1):
         i = int8(2)

Modified: branches/numpy.scons/numpy/f2py/lib/tests/test_scalar_in_out.py
===================================================================
--- branches/numpy.scons/numpy/f2py/lib/tests/test_scalar_in_out.py	2007-11-13 13:10:59 UTC (rev 4450)
+++ branches/numpy.scons/numpy/f2py/lib/tests/test_scalar_in_out.py	2007-11-13 13:51:35 UTC (rev 4451)
@@ -104,7 +104,7 @@
 
 from numpy import *
 
-class test_m(NumpyTestCase):
+class TestM(NumpyTestCase):
 
     def check_foo_integer1(self, level=1):
         i = int8(2)

Modified: branches/numpy.scons/numpy/f2py/rules.py
===================================================================
--- branches/numpy.scons/numpy/f2py/rules.py	2007-11-13 13:10:59 UTC (rev 4450)
+++ branches/numpy.scons/numpy/f2py/rules.py	2007-11-13 13:51:35 UTC (rev 4451)
@@ -57,7 +57,10 @@
 f2py_version = __version__.version
 
 import pprint
-import sys,string,time,types,copy
+import sys
+import time
+import types
+import copy
 errmess=sys.stderr.write
 outmess=sys.stdout.write
 show=pprint.pprint
@@ -1166,7 +1169,7 @@
     fn = os.path.join(options['buildpath'],vrd['modulename']+'module.c')
     ret['csrc'] = fn
     f=open(fn,'w')
-    f.write(string.replace(ar['modulebody'],'\t',2*' '))
+    f.write(ar['modulebody'].replace('\t',2*' '))
     f.close()
     outmess('\tWrote C/API module "%s" to file "%s/%smodule.c"\n'%(m['name'],options['buildpath'],vrd['modulename']))
 
@@ -1174,7 +1177,7 @@
         fn = os.path.join(options['buildpath'],vrd['modulename']+'module.rest')
         f=open(fn,'w')
         f.write('.. -*- rest -*-\n')
-        f.write(string.join(ar['restdoc'],'\n'))
+        f.write('\n'.join(ar['restdoc']))
         f.close()
         outmess('\tReST Documentation is saved to file "%s/%smodule.rest"\n'%(options['buildpath'],vrd['modulename']))
     if options['dolatexdoc']:
@@ -1184,7 +1187,7 @@
         f.write('%% This file is auto-generated with f2py (version:%s)\n'%(f2py_version))
         if not options.has_key('shortlatex'):
             f.write('\\documentclass{article}\n\\usepackage{a4wide}\n\\begin{document}\n\\tableofcontents\n\n')
-        f.write(string.join(ar['latexdoc'],'\n'))
+        f.write('\n'.join(ar['latexdoc']))
         if not options.has_key('shortlatex'):
             f.write('\\end{document}')
         f.close()
@@ -1197,14 +1200,14 @@
         f.write('C     This file is autogenerated with f2py (version:%s)\n'%(f2py_version))
         f.write('C     It contains Fortran 77 wrappers to fortran functions.\n')
         lines = []
-        for l in string.split(string.join(funcwrappers,'\n\n')+'\n','\n'):
+        for l in ('\n\n'.join(funcwrappers)+'\n').split('\n'):
             if l and l[0]==' ':
                 while len(l)>=66:
                     lines.append(l[:66]+'\n     &')
                     l = l[66:]
                 lines.append(l+'\n')
             else: lines.append(l+'\n')
-        lines = string.join(lines,'').replace('\n     &\n','\n')
+        lines = ''.join(lines).replace('\n     &\n','\n')
         f.write(lines)
         f.close()
         outmess('\tFortran 77 wrappers are saved to "%s"\n'%(wn))
@@ -1216,7 +1219,7 @@
         f.write('!     This file is autogenerated with f2py (version:%s)\n'%(f2py_version))
         f.write('!     It contains Fortran 90 wrappers to fortran functions.\n')
         lines = []
-        for l in string.split(string.join(funcwrappers2,'\n\n')+'\n','\n'):
+        for l in '\n\n'.join(funcwrappers2)+'\n'.split('\n'):
             if len(l)>72 and l[0]==' ':
                 lines.append(l[:72]+'&\n     &')
                 l = l[72:]
@@ -1225,7 +1228,7 @@
                     l = l[66:]
                 lines.append(l+'\n')
             else: lines.append(l+'\n')
-        lines = string.join(lines,'').replace('\n     &\n','\n')
+        lines = ''.join(lines).replace('\n     &\n','\n')
         f.write(lines)
         f.close()
         outmess('\tFortran 90 wrappers are saved to "%s"\n'%(wn))
@@ -1313,8 +1316,8 @@
                                         {'docsign':rd['docsign'],
                                          'docsignopt':optargs,
                                          })
-    rd['latexdocsignatureshort']=string.replace(rd['docsignatureshort'],'_','\\_')
-    rd['latexdocsignatureshort']=string.replace(rd['latexdocsignatureshort'],',',', ')
+    rd['latexdocsignatureshort']=rd['docsignatureshort'].replace('_','\\_')
+    rd['latexdocsignatureshort']=rd['latexdocsignatureshort'].replace(',',', ')
     cfs=stripcomma(replace('#callfortran##callfortranappend#',{'callfortran':rd['callfortran'],'callfortranappend':rd['callfortranappend']}))
     if len(rd['callfortranappend'])>1:
         rd['callcompaqfortran']=stripcomma(replace('#callfortran# 0,#callfortranappend#',{'callfortran':rd['callfortran'],'callfortranappend':rd['callfortranappend']}))

Modified: branches/numpy.scons/numpy/f2py/tests/mixed/run.py
===================================================================
--- branches/numpy.scons/numpy/f2py/tests/mixed/run.py	2007-11-13 13:10:59 UTC (rev 4450)
+++ branches/numpy.scons/numpy/f2py/tests/mixed/run.py	2007-11-13 13:51:35 UTC (rev 4451)
@@ -8,7 +8,6 @@
 
 import os
 import sys
-import string
 import f2py2e
 from Numeric import array
 
@@ -19,7 +18,7 @@
         d,b=os.path.split(sys.argv[0])
         files = ['foo.f','foo_fixed.f90','foo_free.f90']
         files = [os.path.join(d,f) for f in files]
-        files = string.join(files)
+        files = ' '.join(files)
         args = ' -c -m mixed_f77_f90 %s %s'%(files,f2py_opts)
         c = '%s -c "import f2py2e;f2py2e.main()" %s' %(sys.executable,args)
         s = os.system(c)

Modified: branches/numpy.scons/numpy/f2py/use_rules.py
===================================================================
--- branches/numpy.scons/numpy/f2py/use_rules.py	2007-11-13 13:10:59 UTC (rev 4450)
+++ branches/numpy.scons/numpy/f2py/use_rules.py	2007-11-13 13:51:35 UTC (rev 4451)
@@ -20,7 +20,10 @@
 f2py_version='See `f2py -v`'
 
 import pprint
-import sys,string,time,types,copy
+import sys
+import time
+import types
+import copy
 errmess=sys.stderr.write
 outmess=sys.stdout.write
 show=pprint.pprint
@@ -88,10 +91,10 @@
     ret={}
     vrd={'name':name,
          'realname':realname,
-         'REALNAME':string.upper(realname),
+         'REALNAME':realname.upper(),
          'usemodulename':usemodulename,
-         'USEMODULENAME':string.upper(usemodulename),
-         'texname':string.replace(name,'_','\\_'),
+         'USEMODULENAME':usemodulename.upper(),
+         'texname':name.replace('_','\\_'),
          'begintitle':gentitle('%s=>%s'%(name,realname)),
          'endtitle':gentitle('end of %s=>%s'%(name,realname)),
          'apiname':'#modulename#_use_%s_from_%s'%(realname,usemodulename)
@@ -99,7 +102,7 @@
     nummap={0:'Ro',1:'Ri',2:'Rii',3:'Riii',4:'Riv',5:'Rv',6:'Rvi',7:'Rvii',8:'Rviii',9:'Rix'}
     vrd['texnamename']=name
     for i in nummap.keys():
-        vrd['texnamename']=string.replace(vrd['texnamename'],`i`,nummap[i])
+        vrd['texnamename']=vrd['texnamename'].replace(`i`,nummap[i])
     if hasnote(vars[realname]): vrd['note']=vars[realname]['note']
     rd=dictappend({},vrd)
     var=vars[realname]

Modified: branches/numpy.scons/numpy/fft/tests/test_fftpack.py
===================================================================
--- branches/numpy.scons/numpy/fft/tests/test_fftpack.py	2007-11-13 13:10:59 UTC (rev 4450)
+++ branches/numpy.scons/numpy/fft/tests/test_fftpack.py	2007-11-13 13:51:35 UTC (rev 4451)
@@ -4,7 +4,7 @@
 from numpy.fft import *
 restore_path()
 
-class test_fftshift(NumpyTestCase):
+class TestFFTShift(NumpyTestCase):
     def check_fft_n(self):
         self.failUnlessRaises(ValueError,fft,[1,2,3],0)
 

Modified: branches/numpy.scons/numpy/fft/tests/test_helper.py
===================================================================
--- branches/numpy.scons/numpy/fft/tests/test_helper.py	2007-11-13 13:10:59 UTC (rev 4450)
+++ branches/numpy.scons/numpy/fft/tests/test_helper.py	2007-11-13 13:51:35 UTC (rev 4451)
@@ -14,7 +14,7 @@
 def random(size):
     return rand(*size)
 
-class test_fftshift(NumpyTestCase):
+class TestFFTShift(NumpyTestCase):
 
     def check_definition(self):
         x = [0,1,2,3,4,-4,-3,-2,-1]
@@ -31,7 +31,7 @@
             x = random((n,))
             assert_array_almost_equal(ifftshift(fftshift(x)),x)
 
-class test_fftfreq(NumpyTestCase):
+class TestFFTFreq(NumpyTestCase):
 
     def check_definition(self):
         x = [0,1,2,3,4,-4,-3,-2,-1]

Modified: branches/numpy.scons/numpy/lib/function_base.py
===================================================================
--- branches/numpy.scons/numpy/lib/function_base.py	2007-11-13 13:10:59 UTC (rev 4450)
+++ branches/numpy.scons/numpy/lib/function_base.py	2007-11-13 13:51:35 UTC (rev 4451)
@@ -1,7 +1,7 @@
 __docformat__ = "restructuredtext en"
 __all__ = ['logspace', 'linspace',
            'select', 'piecewise', 'trim_zeros',
-           'copy', 'iterable', #'base_repr', 'binary_repr',
+           'copy', 'iterable',
            'diff', 'gradient', 'angle', 'unwrap', 'sort_complex', 'disp',
            'unique', 'extract', 'place', 'nansum', 'nanmax', 'nanargmax',
            'nanargmin', 'nanmin', 'vectorize', 'asarray_chkfinite', 'average',
@@ -35,7 +35,35 @@
 
     Return num evenly spaced samples from start to stop.  If
     endpoint is True, the last sample is stop. If retstep is
-    True then return the step value used.
+    True then return (seq, step_value), where step_value used.
+
+    :Parameters:
+        start : {float}
+            The value the sequence starts at.
+        stop : {float}
+            The value the sequence stops at. If ``endpoint`` is false, then
+            this is not included in the sequence. Otherwise it is
+            guaranteed to be the last value.
+        num : {integer}
+            Number of samples to generate. Default is 50.
+        endpoint : {boolean}
+            If true, ``stop`` is the last sample. Otherwise, it is not
+            included. Default is true.
+        retstep : {boolean}
+            If true, return ``(samples, step)``, where ``step`` is the
+            spacing used in generating the samples.
+
+    :Returns:
+        samples : {array}
+            ``num`` equally spaced samples from the range [start, stop]
+            or [start, stop).
+        step : {float} (Only if ``retstep`` is true)
+            Size of spacing between samples.
+
+    :See Also:
+        `arange` : Similiar to linspace, however, when used with
+            a float endpoint, that endpoint may or may not be included.
+        `logspace`
     """
     num = int(num)
     if num <= 0:
@@ -108,6 +136,12 @@
 
     """
     a = asarray(a).ravel()
+
+    if (range is not None):
+        mn, mx = range
+        if (mn > mx):
+            raise AttributeError, 'max must be larger than min in range parameter.'
+
     if not iterable(bins):
         if range is None:
             range = (a.min(), a.max())
@@ -116,6 +150,9 @@
             mn -= 0.5
             mx += 0.5
         bins = linspace(mn, mx, bins, endpoint=False)
+    else:
+        if(any(bins[1:]-bins[:-1] < 0)):
+            raise AttributeError, 'bins must increase monotonically.'
 
     # best block size probably depends on processor cache size
     block = 65536
@@ -914,6 +951,7 @@
                 raise ValueError, "mismatch between python function inputs"\
                       " and received arguments"
 
+        # we need a new ufunc if this is being called with more arguments.
         if (self.lastcallargs != nargs):
             self.lastcallargs = nargs
             self.ufunc = None
@@ -935,14 +973,18 @@
                     otypes.append(asarray(theout[k]).dtype.char)
                 self.otypes = ''.join(otypes)
 
+        # Create ufunc if not already created
         if (self.ufunc is None):
             self.ufunc = frompyfunc(self.thefunc, nargs, self.nout)
 
+        # Convert to object arrays first
+        newargs = [array(arg,copy=False,subok=True,dtype=object) for arg in args]
         if self.nout == 1:
-            _res = array(self.ufunc(*args),copy=False).astype(self.otypes[0])
+            _res = array(self.ufunc(*newargs),copy=False,
+                         subok=True,dtype=self.otypes[0])
         else:
-            _res = tuple([array(x,copy=False).astype(c) \
-                          for x, c in zip(self.ufunc(*args), self.otypes)])
+            _res = tuple([array(x,copy=False,subok=True,dtype=c) \
+                          for x, c in zip(self.ufunc(*newargs), self.otypes)])
         return _res
 
 def cov(m, y=None, rowvar=1, bias=0):

Modified: branches/numpy.scons/numpy/lib/index_tricks.py
===================================================================
--- branches/numpy.scons/numpy/lib/index_tricks.py	2007-11-13 13:10:59 UTC (rev 4450)
+++ branches/numpy.scons/numpy/lib/index_tricks.py	2007-11-13 13:51:35 UTC (rev 4451)
@@ -125,7 +125,7 @@
                   [2],
                   [3],
                   [4]]), array([[0, 1, 2, 3, 4]])]
-           
+
     """
     def __init__(self, sparse=False):
         self.sparse = sparse
@@ -319,7 +319,7 @@
         For example:
         >>> r_[array([1,2,3]), 0, 0, array([4,5,6])]
         array([1, 2, 3, 0, 0, 4, 5, 6])
-        
+
     """
     def __init__(self):
         concatenator.__init__(self, 0)

Modified: branches/numpy.scons/numpy/lib/shape_base.py
===================================================================
--- branches/numpy.scons/numpy/lib/shape_base.py	2007-11-13 13:10:59 UTC (rev 4450)
+++ branches/numpy.scons/numpy/lib/shape_base.py	2007-11-13 13:51:35 UTC (rev 4451)
@@ -299,7 +299,7 @@
                [[2, 3]],
         <BLANKLINE>
                [[3, 4]]])
-        
+
     """
     return _nx.concatenate(map(atleast_3d,tup),2)
 

Modified: branches/numpy.scons/numpy/lib/tests/test_arraysetops.py
===================================================================
--- branches/numpy.scons/numpy/lib/tests/test_arraysetops.py	2007-11-13 13:10:59 UTC (rev 4450)
+++ branches/numpy.scons/numpy/lib/tests/test_arraysetops.py	2007-11-13 13:51:35 UTC (rev 4451)
@@ -11,7 +11,7 @@
 
 ##################################################
 
-class test_aso(NumpyTestCase):
+class TestAso(NumpyTestCase):
     ##
     # 03.11.2005, c
     def check_unique1d( self ):

Modified: branches/numpy.scons/numpy/lib/tests/test_function_base.py
===================================================================
--- branches/numpy.scons/numpy/lib/tests/test_function_base.py	2007-11-13 13:10:59 UTC (rev 4450)
+++ branches/numpy.scons/numpy/lib/tests/test_function_base.py	2007-11-13 13:51:35 UTC (rev 4451)
@@ -7,7 +7,7 @@
 from numpy.core import *
 del sys.path[0]
 
-class test_any(NumpyTestCase):
+class TestAny(NumpyTestCase):
     def check_basic(self):
         y1 = [0,0,1,0]
         y2 = [0,0,0,0]
@@ -22,7 +22,7 @@
         assert_array_equal(sometrue(y1,axis=0),[1,1,0])
         assert_array_equal(sometrue(y1,axis=1),[0,1,1])
 
-class test_all(NumpyTestCase):
+class TestAll(NumpyTestCase):
     def check_basic(self):
         y1 = [0,1,1,0]
         y2 = [0,0,0,0]
@@ -38,7 +38,7 @@
         assert_array_equal(alltrue(y1,axis=0),[0,0,1])
         assert_array_equal(alltrue(y1,axis=1),[0,0,1])
 
-class test_average(NumpyTestCase):
+class TestAverage(NumpyTestCase):
     def check_basic(self):
         y1 = array([1,2,3])
         assert(average(y1,axis=0) == 2.)
@@ -64,7 +64,7 @@
         desired = array([3.,4.,5.])
         assert_array_equal(actual, desired)
 
-class test_select(NumpyTestCase):
+class TestSelect(NumpyTestCase):
     def _select(self,cond,values,default=0):
         output = []
         for m in range(len(cond)):
@@ -84,7 +84,7 @@
         assert_equal(len(choices),3)
         assert_equal(len(conditions),3)
 
-class test_logspace(NumpyTestCase):
+class TestLogspace(NumpyTestCase):
     def check_basic(self):
         y = logspace(0,6)
         assert(len(y)==50)
@@ -95,7 +95,7 @@
         y = logspace(0,6,num=7)
         assert_array_equal(y,[1,10,100,1e3,1e4,1e5,1e6])
 
-class test_linspace(NumpyTestCase):
+class TestLinspace(NumpyTestCase):
     def check_basic(self):
         y = linspace(0,10)
         assert(len(y)==50)
@@ -120,14 +120,14 @@
         assert_equal(t1, t2)
         assert_equal(t2, t3)
 
-class test_insert(NumpyTestCase):
+class TestInsert(NumpyTestCase):
     def check_basic(self):
         a = [1,2,3]
         assert_equal(insert(a,0,1), [1,1,2,3])
         assert_equal(insert(a,3,1), [1,2,3,1])
         assert_equal(insert(a,[1,1,1],[1,2,3]), [1,1,2,3,2,3])
 
-class test_amax(NumpyTestCase):
+class TestAmax(NumpyTestCase):
     def check_basic(self):
         a = [3,4,5,10,-3,-5,6.0]
         assert_equal(amax(a),10.0)
@@ -137,7 +137,7 @@
         assert_equal(amax(b,axis=0),[8.0,10.0,9.0])
         assert_equal(amax(b,axis=1),[9.0,10.0,8.0])
 
-class test_amin(NumpyTestCase):
+class TestAmin(NumpyTestCase):
     def check_basic(self):
         a = [3,4,5,10,-3,-5,6.0]
         assert_equal(amin(a),-5.0)
@@ -147,7 +147,7 @@
         assert_equal(amin(b,axis=0),[3.0,3.0,2.0])
         assert_equal(amin(b,axis=1),[3.0,4.0,2.0])
 
-class test_ptp(NumpyTestCase):
+class TestPtp(NumpyTestCase):
     def check_basic(self):
         a = [3,4,5,10,-3,-5,6.0]
         assert_equal(ptp(a,axis=0),15.0)
@@ -157,7 +157,7 @@
         assert_equal(ptp(b,axis=0),[5.0,7.0,7.0])
         assert_equal(ptp(b,axis=-1),[6.0,6.0,6.0])
 
-class test_cumsum(NumpyTestCase):
+class TestCumsum(NumpyTestCase):
     def check_basic(self):
         ba = [1,2,10,11,6,5,4]
         ba2 = [[1,2,3,4],[5,6,7,9],[10,3,4,5]]
@@ -173,7 +173,7 @@
                                       [5,11,18,27],
                                       [10,13,17,22]],ctype))
 
-class test_prod(NumpyTestCase):
+class TestProd(NumpyTestCase):
     def check_basic(self):
         ba = [1,2,10,11,6,5,4]
         ba2 = [[1,2,3,4],[5,6,7,9],[10,3,4,5]]
@@ -191,7 +191,7 @@
                                    array([50,36,84,180],ctype))
                 assert_array_equal(prod(a2,axis=-1),array([24, 1890, 600],ctype))
 
-class test_cumprod(NumpyTestCase):
+class TestCumprod(NumpyTestCase):
     def check_basic(self):
         ba = [1,2,10,11,6,5,4]
         ba2 = [[1,2,3,4],[5,6,7,9],[10,3,4,5]]
@@ -216,7 +216,7 @@
                                           [ 5, 30, 210, 1890],
                                           [10, 30, 120,  600]],ctype))
 
-class test_diff(NumpyTestCase):
+class TestDiff(NumpyTestCase):
     def check_basic(self):
         x = [1,4,6,7,12]
         out = array([3,2,1,5])
@@ -237,7 +237,7 @@
         assert_array_equal(diff(x,axis=0),out3)
         assert_array_equal(diff(x,n=2,axis=0),out4)
 
-class test_angle(NumpyTestCase):
+class TestAngle(NumpyTestCase):
     def check_basic(self):
         x = [1+3j,sqrt(2)/2.0+1j*sqrt(2)/2,1,1j,-1,-1j,1-3j,-1+3j]
         y = angle(x)
@@ -248,7 +248,7 @@
         assert_array_almost_equal(y,yo,11)
         assert_array_almost_equal(z,zo,11)
 
-class test_trim_zeros(NumpyTestCase):
+class TestTrimZeros(NumpyTestCase):
     """ only testing for integer splits.
     """
     def check_basic(self):
@@ -265,7 +265,7 @@
         assert_array_equal(res,array([1,0,2,3,0,4]))
 
 
-class test_extins(NumpyTestCase):
+class TestExtins(NumpyTestCase):
     def check_basic(self):
         a = array([1,3,2,1,2,3,3])
         b = extract(a>1,a)
@@ -283,7 +283,7 @@
         place(a,mask,c)
         assert_array_equal(a,ac)
 
-class test_vectorize(NumpyTestCase):
+class TestVectorize(NumpyTestCase):
     def check_simple(self):
         def addsubtract(a,b):
             if a > b:
@@ -308,7 +308,7 @@
         y = f(x)
         assert_array_equal(y, x)
 
-class test_digitize(NumpyTestCase):
+class TestDigitize(NumpyTestCase):
     def check_forward(self):
         x = arange(-6,5)
         bins = arange(-5,5)
@@ -324,7 +324,7 @@
         bin = linspace(x.min(), x.max(), 10)
         assert all(digitize(x,bin) != 0)
 
-class test_unwrap(NumpyTestCase):
+class TestUnwrap(NumpyTestCase):
     def check_simple(self):
                 #check that unwrap removes jumps greather that 2*pi
         assert_array_equal(unwrap([1,1+2*pi]),[1,1])
@@ -332,7 +332,7 @@
         assert(all(diff(unwrap(rand(10)*100))<pi))
 
 
-class test_filterwindows(NumpyTestCase):
+class TestFilterwindows(NumpyTestCase):
     def check_hanning(self):
         #check symmetry
         w=hanning(10)
@@ -362,20 +362,20 @@
         assert_almost_equal(sum(w,axis=0),3.7800,4)
 
 
-class test_trapz(NumpyTestCase):
+class TestTrapz(NumpyTestCase):
     def check_simple(self):
         r=trapz(exp(-1.0/2*(arange(-10,10,.1))**2)/sqrt(2*pi),dx=0.1)
         #check integral of normal equals 1
         assert_almost_equal(sum(r,axis=0),1,7)
 
-class test_sinc(NumpyTestCase):
+class TestSinc(NumpyTestCase):
     def check_simple(self):
         assert(sinc(0)==1)
         w=sinc(linspace(-1,1,100))
         #check symmetry
         assert_array_almost_equal(w,flipud(w),7)
 
-class test_histogram(NumpyTestCase):
+class TestHistogram(NumpyTestCase):
     def check_simple(self):
         n=100
         v=rand(n)
@@ -386,7 +386,7 @@
         (a,b)=histogram(linspace(0,10,100))
         assert(all(a==10))
 
-class test_histogramdd(NumpyTestCase):
+class TestHistogramdd(NumpyTestCase):
     def check_simple(self):
         x = array([[-.5, .5, 1.5], [-.5, 1.5, 2.5], [-.5, 2.5, .5], \
         [.5, .5, 1.5], [.5, 1.5, 2.5], [.5, 2.5, 2.5]])
@@ -436,7 +436,7 @@
         hist, edges = histogramdd(x, bins=2)
         assert_array_equal(edges[0],array([-0.5,  0. ,  0.5]))
 
-class test_unique(NumpyTestCase):
+class TestUnique(NumpyTestCase):
     def check_simple(self):
         x = array([4,3,2,1,1,2,3,4, 0])
         assert(all(unique(x) == [0,1,2,3,4]))

Modified: branches/numpy.scons/numpy/lib/tests/test_getlimits.py
===================================================================
--- branches/numpy.scons/numpy/lib/tests/test_getlimits.py	2007-11-13 13:10:59 UTC (rev 4450)
+++ branches/numpy.scons/numpy/lib/tests/test_getlimits.py	2007-11-13 13:51:35 UTC (rev 4451)
@@ -11,31 +11,31 @@
 
 ##################################################
 
-class test_python_float(NumpyTestCase):
+class TestPythonFloat(NumpyTestCase):
     def check_singleton(self):
         ftype = finfo(float)
         ftype2 = finfo(float)
         assert_equal(id(ftype),id(ftype2))
 
-class test_single(NumpyTestCase):
+class TestSingle(NumpyTestCase):
     def check_singleton(self):
         ftype = finfo(single)
         ftype2 = finfo(single)
         assert_equal(id(ftype),id(ftype2))
 
-class test_double(NumpyTestCase):
+class TestDouble(NumpyTestCase):
     def check_singleton(self):
         ftype = finfo(double)
         ftype2 = finfo(double)
         assert_equal(id(ftype),id(ftype2))
 
-class test_longdouble(NumpyTestCase):
+class TestLongdouble(NumpyTestCase):
     def check_singleton(self,level=2):
         ftype = finfo(longdouble)
         ftype2 = finfo(longdouble)
         assert_equal(id(ftype),id(ftype2))
 
-class test_iinfo(NumpyTestCase):
+class TestIinfo(NumpyTestCase):
     def check_basic(self):
         dts = zip(['i1', 'i2', 'i4', 'i8',
                    'u1', 'u2', 'u4', 'u8'],

Modified: branches/numpy.scons/numpy/lib/tests/test_index_tricks.py
===================================================================
--- branches/numpy.scons/numpy/lib/tests/test_index_tricks.py	2007-11-13 13:10:59 UTC (rev 4450)
+++ branches/numpy.scons/numpy/lib/tests/test_index_tricks.py	2007-11-13 13:51:35 UTC (rev 4451)
@@ -3,7 +3,7 @@
 from numpy import array, ones, r_, mgrid
 restore_path()
 
-class test_grid(NumpyTestCase):
+class TestGrid(NumpyTestCase):
     def check_basic(self):
         a = mgrid[-1:1:10j]
         b = mgrid[-1:1:0.1]
@@ -28,7 +28,7 @@
         assert_array_almost_equal(d[0,1,:]-d[0,0,:], 0.1*ones(20,'d'),11)
         assert_array_almost_equal(d[1,:,1]-d[1,:,0], 0.2*ones(20,'d'),11)
 
-class test_concatenator(NumpyTestCase):
+class TestConcatenator(NumpyTestCase):
     def check_1d(self):
         assert_array_equal(r_[1,2,3,4,5,6],array([1,2,3,4,5,6]))
         b = ones(5)

Modified: branches/numpy.scons/numpy/lib/tests/test_polynomial.py
===================================================================
--- branches/numpy.scons/numpy/lib/tests/test_polynomial.py	2007-11-13 13:10:59 UTC (rev 4450)
+++ branches/numpy.scons/numpy/lib/tests/test_polynomial.py	2007-11-13 13:51:35 UTC (rev 4451)
@@ -76,7 +76,7 @@
 from numpy.testing import *
 import numpy as N
 
-class test_docs(NumpyTestCase):
+class TestDocs(NumpyTestCase):
     def check_doctests(self): return self.rundocs()
 
     def check_roots(self):

Modified: branches/numpy.scons/numpy/lib/tests/test_shape_base.py
===================================================================
--- branches/numpy.scons/numpy/lib/tests/test_shape_base.py	2007-11-13 13:10:59 UTC (rev 4450)
+++ branches/numpy.scons/numpy/lib/tests/test_shape_base.py	2007-11-13 13:51:35 UTC (rev 4451)
@@ -5,7 +5,7 @@
 from numpy.core import *
 restore_path()
 
-class test_apply_along_axis(NumpyTestCase):
+class TestApplyAlongAxis(NumpyTestCase):
     def check_simple(self):
         a = ones((20,10),'d')
         assert_array_equal(apply_along_axis(len,0,a),len(a)*ones(shape(a)[1]))
@@ -17,7 +17,7 @@
         a = arange(27).reshape((3,3,3))
         assert_array_equal(apply_along_axis(sum,0,a), [[27,30,33],[36,39,42],[45,48,51]])
 
-class test_array_split(NumpyTestCase):
+class TestArraySplit(NumpyTestCase):
     def check_integer_0_split(self):
         a = arange(10)
         try:
@@ -120,7 +120,7 @@
                    array([]),array([])]
         compare_results(res,desired)
 
-class test_split(NumpyTestCase):
+class TestSplit(NumpyTestCase):
     """* This function is essentially the same as array_split,
          except that it test if splitting will result in an
          equal split.  Only test for this case.
@@ -139,7 +139,7 @@
         except ValueError:
             pass
 
-class test_atleast_1d(NumpyTestCase):
+class TestAtleast1d(NumpyTestCase):
     def check_0D_array(self):
         a = array(1); b = array(2);
         res=map(atleast_1d,[a,b])
@@ -170,7 +170,7 @@
         assert(atleast_1d(3.0).shape == (1,))
         assert(atleast_1d([[2,3],[4,5]]).shape == (2,2))
 
-class test_atleast_2d(NumpyTestCase):
+class TestAtleast2d(NumpyTestCase):
     def check_0D_array(self):
         a = array(1); b = array(2);
         res=map(atleast_2d,[a,b])
@@ -199,7 +199,7 @@
         assert(atleast_2d([3j,1]).shape == (1,2))
         assert(atleast_2d([[[3,1],[4,5]],[[3,5],[1,2]]]).shape == (2,2,2))
 
-class test_atleast_3d(NumpyTestCase):
+class TestAtleast3d(NumpyTestCase):
     def check_0D_array(self):
         a = array(1); b = array(2);
         res=map(atleast_3d,[a,b])
@@ -222,7 +222,7 @@
         desired = [a,b]
         assert_array_equal(res,desired)
 
-class test_hstack(NumpyTestCase):
+class TestHstack(NumpyTestCase):
     def check_0D_array(self):
         a = array(1); b = array(2);
         res=hstack([a,b])
@@ -239,7 +239,7 @@
         desired = array([[1,1],[2,2]])
         assert_array_equal(res,desired)
 
-class test_vstack(NumpyTestCase):
+class TestVstack(NumpyTestCase):
     def check_0D_array(self):
         a = array(1); b = array(2);
         res=vstack([a,b])
@@ -261,7 +261,7 @@
         desired = array([[1,2],[1,2]])
         assert_array_equal(res,desired)
 
-class test_dstack(NumpyTestCase):
+class TestDstack(NumpyTestCase):
     def check_0D_array(self):
         a = array(1); b = array(2);
         res=dstack([a,b])
@@ -286,7 +286,7 @@
 """ array_split has more comprehensive test of splitting.
     only do simple test on hsplit, vsplit, and dsplit
 """
-class test_hsplit(NumpyTestCase):
+class TestHsplit(NumpyTestCase):
     """ only testing for integer splits.
     """
     def check_0D_array(self):
@@ -308,7 +308,7 @@
         desired = [array([[1,2],[1,2]]),array([[3,4],[3,4]])]
         compare_results(res,desired)
 
-class test_vsplit(NumpyTestCase):
+class TestVsplit(NumpyTestCase):
     """ only testing for integer splits.
     """
     def check_1D_array(self):
@@ -325,7 +325,7 @@
         desired = [array([[1,2,3,4]]),array([[1,2,3,4]])]
         compare_results(res,desired)
 
-class test_dsplit(NumpyTestCase):
+class TestDsplit(NumpyTestCase):
     """ only testing for integer splits.
     """
     def check_2D_array(self):
@@ -346,7 +346,7 @@
                    array([[[3,4],[3,4]],[[3,4],[3,4]]])]
         compare_results(res,desired)
 
-class test_squeeze(NumpyTestCase):
+class TestSqueeze(NumpyTestCase):
     def check_basic(self):
         a = rand(20,10,10,1,1)
         b = rand(20,1,10,1,20)
@@ -355,7 +355,7 @@
         assert_array_equal(squeeze(b),reshape(b,(20,10,20)))
         assert_array_equal(squeeze(c),reshape(c,(20,10)))
 
-class test_kron(NumpyTestCase):
+class TestKron(NumpyTestCase):
     def check_return_type(self):
         a = ones([2,2])
         m = asmatrix(a)
@@ -372,7 +372,7 @@
         assert_equal(type(kron(ma,a)), myarray)
 
 
-class test_tile(NumpyTestCase):
+class TestTile(NumpyTestCase):
     def check_basic(self):
         a = array([0,1,2])
         b = [[1,2],[3,4]]
@@ -410,4 +410,3 @@
 
 if __name__ == "__main__":
     NumpyTest().run()
- 

Modified: branches/numpy.scons/numpy/lib/tests/test_twodim_base.py
===================================================================
--- branches/numpy.scons/numpy/lib/tests/test_twodim_base.py	2007-11-13 13:10:59 UTC (rev 4450)
+++ branches/numpy.scons/numpy/lib/tests/test_twodim_base.py	2007-11-13 13:51:35 UTC (rev 4451)
@@ -5,7 +5,7 @@
 from numpy.testing import *
 set_package_path()
 from numpy import arange, rot90, add, fliplr, flipud, zeros, ones, eye, \
-     array, diag, histogram2d
+     array, diag, histogram2d, tri
 import numpy as np
 restore_path()
 
@@ -17,7 +17,7 @@
     data = add.outer(data,data)
     return data
 
-class test_eye(NumpyTestCase):
+class TestEye(NumpyTestCase):
     def check_basic(self):
         assert_equal(eye(4),array([[1,0,0,0],
                                    [0,1,0,0],
@@ -55,7 +55,7 @@
                                           [1,0,0],
                                           [0,1,0]]))
 
-class test_diag(NumpyTestCase):
+class TestDiag(NumpyTestCase):
     def check_vector(self):
         vals = (100*arange(5)).astype('l')
         b = zeros((5,5))
@@ -84,7 +84,7 @@
             b[k] = vals[k+2,k]
         assert_equal(diag(vals,-2),b[:3])
 
-class test_fliplr(NumpyTestCase):
+class TestFliplr(NumpyTestCase):
     def check_basic(self):
         self.failUnlessRaises(ValueError, fliplr, ones(4))
         a = get_mat(4)
@@ -96,7 +96,7 @@
              [5,4,3]]
         assert_equal(fliplr(a),b)
 
-class test_flipud(NumpyTestCase):
+class TestFlipud(NumpyTestCase):
     def check_basic(self):
         a = get_mat(4)
         b = a[::-1,:]
@@ -107,7 +107,7 @@
              [0,1,2]]
         assert_equal(flipud(a),b)
 
-class test_rot90(NumpyTestCase):
+class TestRot90(NumpyTestCase):
     def check_basic(self):
         self.failUnlessRaises(ValueError, rot90, ones(4))
 
@@ -137,7 +137,7 @@
         a = ones((50,40,3))
         assert_equal(rot90(a).shape,(40,50,3))
 
-class test_histogram2d(NumpyTestCase):
+class TestHistogram2d(NumpyTestCase):
     def check_simple(self):
         x = array([ 0.41702200,  0.72032449,  0.00011437481, 0.302332573,  0.146755891])
         y = array([ 0.09233859,  0.18626021,  0.34556073,  0.39676747,  0.53881673])
@@ -160,7 +160,7 @@
         assert_array_equal(H, eye(10,10))
         assert_array_equal(xedges, np.linspace(0,9,11))
         assert_array_equal(yedges, np.linspace(0,9,11))
-        
+
     def check_asym(self):
         x = array([1, 1, 2, 3, 4, 4, 4, 5])
         y = array([1, 3, 2, 0, 1, 2, 3, 4])
@@ -187,6 +187,14 @@
         r = rand(100)+1.
         H, xed, yed = histogram2d(r, r, (4, 5), range=([0,1], [0,1]))
         assert_array_equal(H, 0)
-        
+
+class TestTri(NumpyTestCase):
+    def test_dtype(self):
+        out = array([[1,0,0],
+                     [1,1,0],
+                     [1,1,1]])
+        assert_array_equal(tri(3),out)
+        assert_array_equal(tri(3,dtype=bool),out.astype(bool))
+
 if __name__ == "__main__":
     NumpyTest().run()

Modified: branches/numpy.scons/numpy/lib/tests/test_type_check.py
===================================================================
--- branches/numpy.scons/numpy/lib/tests/test_type_check.py	2007-11-13 13:10:59 UTC (rev 4450)
+++ branches/numpy.scons/numpy/lib/tests/test_type_check.py	2007-11-13 13:51:35 UTC (rev 4451)
@@ -10,7 +10,7 @@
 def assert_all(x):
     assert(all(x)), x
 
-class test_mintypecode(NumpyTestCase):
+class TestMintypecode(NumpyTestCase):
 
     def check_default_1(self):
         for itype in '1bcsuwil':
@@ -59,7 +59,7 @@
         #assert_equal(mintypecode('idF',savespace=1),'F')
         assert_equal(mintypecode('idD'),'D')
 
-class test_isscalar(NumpyTestCase):
+class TestIsscalar(NumpyTestCase):
     def check_basic(self):
         assert(isscalar(3))
         assert(not isscalar([3]))
@@ -68,7 +68,7 @@
         assert(isscalar(10L))
         assert(isscalar(4.0))
 
-class test_real(NumpyTestCase):
+class TestReal(NumpyTestCase):
     def check_real(self):
         y = rand(10,)
         assert_array_equal(y,real(y))
@@ -77,7 +77,7 @@
         y = rand(10,)+1j*rand(10,)
         assert_array_equal(y.real,real(y))
 
-class test_imag(NumpyTestCase):
+class TestImag(NumpyTestCase):
     def check_real(self):
         y = rand(10,)
         assert_array_equal(0,imag(y))
@@ -86,7 +86,7 @@
         y = rand(10,)+1j*rand(10,)
         assert_array_equal(y.imag,imag(y))
 
-class test_iscomplex(NumpyTestCase):
+class TestIscomplex(NumpyTestCase):
     def check_fail(self):
         z = array([-1,0,1])
         res = iscomplex(z)
@@ -96,7 +96,7 @@
         res = iscomplex(z)
         assert_array_equal(res,[1,0,0])
 
-class test_isreal(NumpyTestCase):
+class TestIsreal(NumpyTestCase):
     def check_pass(self):
         z = array([-1,0,1j])
         res = isreal(z)
@@ -106,21 +106,21 @@
         res = isreal(z)
         assert_array_equal(res,[0,1,1])
 
-class test_iscomplexobj(NumpyTestCase):
+class TestIscomplexobj(NumpyTestCase):
     def check_basic(self):
         z = array([-1,0,1])
         assert(not iscomplexobj(z))
         z = array([-1j,0,-1])
         assert(iscomplexobj(z))
 
-class test_isrealobj(NumpyTestCase):
+class TestIsrealobj(NumpyTestCase):
     def check_basic(self):
         z = array([-1,0,1])
         assert(isrealobj(z))
         z = array([-1j,0,-1])
         assert(not isrealobj(z))
 
-class test_isnan(NumpyTestCase):
+class TestIsnan(NumpyTestCase):
     def check_goodvalues(self):
         z = array((-1.,0.,1.))
         res = isnan(z) == 0
@@ -148,7 +148,7 @@
         assert_all(isnan(array(0+0j)/0.) == 1)
         seterr(**olderr)
 
-class test_isfinite(NumpyTestCase):
+class TestIsfinite(NumpyTestCase):
     def check_goodvalues(self):
         z = array((-1.,0.,1.))
         res = isfinite(z) == 1
@@ -176,7 +176,7 @@
         assert_all(isfinite(array(1+1j)/0.) == 0)
         seterr(**olderr)
 
-class test_isinf(NumpyTestCase):
+class TestIsinf(NumpyTestCase):
     def check_goodvalues(self):
         z = array((-1.,0.,1.))
         res = isinf(z) == 0
@@ -205,7 +205,7 @@
     #    assert_all(isinf(log(-1.)) == 0)
     #    assert_all(isnan(log(-1.)) == 1)
 
-class test_isposinf(NumpyTestCase):
+class TestIsposinf(NumpyTestCase):
     def check_generic(self):
         olderr = seterr(divide='ignore', invalid='ignore')
         vals = isposinf(array((-1.,0,1))/0.)
@@ -214,7 +214,7 @@
         assert(vals[1] == 0)
         assert(vals[2] == 1)
 
-class test_isneginf(NumpyTestCase):
+class TestIsneginf(NumpyTestCase):
     def check_generic(self):
         olderr = seterr(divide='ignore', invalid='ignore')
         vals = isneginf(array((-1.,0,1))/0.)
@@ -223,7 +223,7 @@
         assert(vals[1] == 0)
         assert(vals[2] == 0)
 
-class test_nan_to_num(NumpyTestCase):
+class TestNanToNum(NumpyTestCase):
     def check_generic(self):
         olderr = seterr(divide='ignore', invalid='ignore')
         vals = nan_to_num(array((-1.,0,1))/0.)
@@ -259,7 +259,7 @@
         #assert_all(vals.real < -1e10) and assert_all(isfinite(vals))
 
 
-class test_real_if_close(NumpyTestCase):
+class TestRealIfClose(NumpyTestCase):
     def check_basic(self):
         a = rand(10)
         b = real_if_close(a+1e-15j)
@@ -270,7 +270,7 @@
         b = real_if_close(a+1e-7j,tol=1e-6)
         assert_all(isrealobj(b))
 
-class test_array_conversion(NumpyTestCase):
+class TestArrayConversion(NumpyTestCase):
     def check_asfarray(self):
         a = asfarray(array([1,2,3]))
         assert_equal(a.__class__,ndarray)

Modified: branches/numpy.scons/numpy/lib/tests/test_ufunclike.py
===================================================================
--- branches/numpy.scons/numpy/lib/tests/test_ufunclike.py	2007-11-13 13:10:59 UTC (rev 4450)
+++ branches/numpy.scons/numpy/lib/tests/test_ufunclike.py	2007-11-13 13:51:35 UTC (rev 4451)
@@ -59,7 +59,7 @@
 
 from numpy.testing import *
 
-class test_docs(NumpyTestCase):
+class TestDocs(NumpyTestCase):
     def check_doctests(self): return self.rundocs()
 
 if __name__ == "__main__":

Modified: branches/numpy.scons/numpy/lib/twodim_base.py
===================================================================
--- branches/numpy.scons/numpy/lib/twodim_base.py	2007-11-13 13:10:59 UTC (rev 4450)
+++ branches/numpy.scons/numpy/lib/twodim_base.py	2007-11-13 13:51:35 UTC (rev 4451)
@@ -108,8 +108,7 @@
     """
     if M is None: M = N
     m = greater_equal(subtract.outer(arange(N), arange(M)),-k)
-    if m.dtype != dtype:
-        return m.astype(dtype)
+    return m.astype(dtype)
 
 def tril(m, k=0):
     """ returns the elements on and below the k-th diagonal of m.  k=0 is the
@@ -144,7 +143,7 @@
         X[:,i] = x**(N-i-1)
     return X
 
-    
+
 def histogram2d(x,y, bins=10, range=None, normed=False, weights=None):
     """histogram2d(x,y, bins=10, range=None, normed=False) -> H, xedges, yedges
 
@@ -152,27 +151,27 @@
 
     :Parameters:
       - `x,y` : Sample arrays (1D).
-      - `bins` : Number of bins -or- [nbin x, nbin y] -or- 
+      - `bins` : Number of bins -or- [nbin x, nbin y] -or-
              [bin edges] -or- [x bin edges, y bin edges].
       - `range` : A sequence of lower and upper bin edges (default: [min, max]).
       - `normed` : Boolean, if False, return the number of samples in each bin,
                 if True, returns the density.
-      - `weights` : An array of weights. The weights are normed only if normed 
+      - `weights` : An array of weights. The weights are normed only if normed
                 is True. Should weights.sum() not equal N, the total bin count \
                 will not be equal to the number of samples.
-    
+
     :Return:
       - `hist` :    Histogram array.
-      - `xedges, yedges` : Arrays defining the bin edges. 
-    
+      - `xedges, yedges` : Arrays defining the bin edges.
+
     Example:
       >>> x = random.randn(100,2)
       >>> hist2d, xedges, yedges = histogram2d(x, bins = (6, 7))
-    
+
     :SeeAlso: histogramdd
     """
     from numpy import histogramdd
-    
+
     try:
         N = len(bins)
     except TypeError:

Modified: branches/numpy.scons/numpy/lib/type_check.py
===================================================================
--- branches/numpy.scons/numpy/lib/type_check.py	2007-11-13 13:10:59 UTC (rev 4450)
+++ branches/numpy.scons/numpy/lib/type_check.py	2007-11-13 13:51:35 UTC (rev 4451)
@@ -7,7 +7,7 @@
 
 import numpy.core.numeric as _nx
 from numpy.core.numeric import asarray, asanyarray, array, isnan, \
-		obj2sctype, zeros
+                obj2sctype, zeros
 from ufunclike import isneginf, isposinf
 
 _typecodes_by_elsize = 'GDFgdfQqLlIiHhBb?'

Modified: branches/numpy.scons/numpy/lib/utils.py
===================================================================
--- branches/numpy.scons/numpy/lib/utils.py	2007-11-13 13:10:59 UTC (rev 4450)
+++ branches/numpy.scons/numpy/lib/utils.py	2007-11-13 13:51:35 UTC (rev 4451)
@@ -118,7 +118,7 @@
     high is just *past* the last byte
 
     If the array is not single-segment, then it may not actually
-    use every byte between these bounds. 
+    use every byte between these bounds.
 
     The array provided must conform to the Python-side of the array interface
     """
@@ -140,8 +140,8 @@
                 a_high += (shape-1)*stride
         a_high += bytes_a
     return a_low, a_high
-    
 
+
 def may_share_memory(a, b):
     """Determine if two arrays can share memory
 
@@ -275,7 +275,7 @@
        Example:
           >>> from numpy import *
           >>> info(polyval) # doctest: +SKIP
-          
+
           polyval(p, x)
 
             Evaluate the polymnomial p at x.

Modified: branches/numpy.scons/numpy/linalg/SConstruct
===================================================================
--- branches/numpy.scons/numpy/linalg/SConstruct	2007-11-13 13:10:59 UTC (rev 4450)
+++ branches/numpy.scons/numpy/linalg/SConstruct	2007-11-13 13:51:35 UTC (rev 4451)
@@ -1,5 +1,7 @@
-# Last Change: Mon Oct 29 06:00 PM 2007 J
+# Last Change: Tue Nov 13 10:00 PM 2007 J
 # vim:syntax=python
+import os.path
+
 from numpy.distutils.misc_util import get_numpy_include_dirs, get_mathlibs
 from numpy.distutils.scons import GetNumpyEnvironment, scons_get_paths
 from numpy.distutils.scons import CheckLAPACK
@@ -14,12 +16,15 @@
 use_lapack = config.CheckLAPACK()
 
 # XXX: this is ugly, better find the mathlibs with a checker 
-for i in scons_get_paths(env['include_bootstrap']):
-    try:
-        mlib =  get_mathlibs(i)
-        break
-    except IOError:
-        pass
+def custom_get_mathlib():
+    for i in scons_get_paths(env['include_bootstrap']):
+        try:
+            mlib =  get_mathlibs(i)
+            return mlib
+        except IOError:
+            pass
+    raise RuntimeError("FIXME: no mlib found ?")
+mlib = custom_get_mathlib()
 env.AppendUnique(LIBS = mlib)
 
 config.Finish()

Modified: branches/numpy.scons/numpy/linalg/lapack_lite/clapack_scrub.py
===================================================================
--- branches/numpy.scons/numpy/linalg/lapack_lite/clapack_scrub.py	2007-11-13 13:10:59 UTC (rev 4450)
+++ branches/numpy.scons/numpy/linalg/lapack_lite/clapack_scrub.py	2007-11-13 13:51:35 UTC (rev 4451)
@@ -273,4 +273,3 @@
     writefo = open(outfilename, 'w')
     writefo.write(source)
     writefo.close()
-

Modified: branches/numpy.scons/numpy/linalg/lapack_lite/make_lite.py
===================================================================
--- branches/numpy.scons/numpy/linalg/lapack_lite/make_lite.py	2007-11-13 13:10:59 UTC (rev 4450)
+++ branches/numpy.scons/numpy/linalg/lapack_lite/make_lite.py	2007-11-13 13:51:35 UTC (rev 4451)
@@ -141,7 +141,7 @@
 class LapackLibrary(FortranLibrary):
     def _newFortranRoutine(self, rname, filename):
         routine = FortranLibrary._newFortranRoutine(self, rname, filename)
-        if filename.find('BLAS') != -1:
+        if 'BLAS' in filename
             routine.type = 'blas'
         elif rname.startswith('z'):
             routine.type = 'zlapack'

Modified: branches/numpy.scons/numpy/linalg/lapack_litemodule.c
===================================================================
--- branches/numpy.scons/numpy/linalg/lapack_litemodule.c	2007-11-13 13:10:59 UTC (rev 4450)
+++ branches/numpy.scons/numpy/linalg/lapack_litemodule.c	2007-11-13 13:51:35 UTC (rev 4451)
@@ -765,7 +765,7 @@
         lapack_lite_status__ = \
         FNAME(zgeqrf)(&m, &n, ZDATA(a), &lda, ZDATA(tau), ZDATA(work), &lwork, &info);
 
-        return Py_BuildValue("{s:l,s:l,s:l,s:l,s:l,s:l}","zgeqrf_",lapack_lite_status__,"m",m,"n",n,"lda",lda,"lwork",lwork,"info",info);
+        return Py_BuildValue("{s:i,s:i,s:i,s:i,s:i,s:i}","zgeqrf_",lapack_lite_status__,"m",m,"n",n,"lda",lda,"lwork",lwork,"info",info);
 }
 
 

Modified: branches/numpy.scons/numpy/matlib.py
===================================================================
--- branches/numpy.scons/numpy/matlib.py	2007-11-13 13:10:59 UTC (rev 4450)
+++ branches/numpy.scons/numpy/matlib.py	2007-11-13 13:51:35 UTC (rev 4451)
@@ -40,12 +40,12 @@
 
 def rand(*args):
     if isinstance(args[0], tuple):
-       args = args[0]
+        args = args[0]
     return asmatrix(N.random.rand(*args))
 
 def randn(*args):
     if isinstance(args[0], tuple):
-       args = args[0]
+        args = args[0]
     return asmatrix(N.random.randn(*args))
 
 def repmat(a, m, n):

Modified: branches/numpy.scons/numpy/numarray/image.py
===================================================================
--- branches/numpy.scons/numpy/numarray/image.py	2007-11-13 13:10:59 UTC (rev 4450)
+++ branches/numpy.scons/numpy/numarray/image.py	2007-11-13 13:51:35 UTC (rev 4451)
@@ -12,4 +12,3 @@
 installing all of SciPy from http://www.scipy.org.
 """
         raise ImportError(msg)
-

Modified: branches/numpy.scons/numpy/numarray/matrix.py
===================================================================
--- branches/numpy.scons/numpy/numarray/matrix.py	2007-11-13 13:10:59 UTC (rev 4450)
+++ branches/numpy.scons/numpy/numarray/matrix.py	2007-11-13 13:51:35 UTC (rev 4451)
@@ -5,4 +5,3 @@
 
 def Matrix(data, typecode=None, copy=1, savespace=0):
     return _matrix(data, typecode, copy=copy)
-

Modified: branches/numpy.scons/numpy/numarray/numerictypes.py
===================================================================
--- branches/numpy.scons/numpy/numarray/numerictypes.py	2007-11-13 13:10:59 UTC (rev 4450)
+++ branches/numpy.scons/numpy/numarray/numerictypes.py	2007-11-13 13:51:35 UTC (rev 4451)
@@ -472,22 +472,22 @@
         Complex64 : Complex64
         }
 else:
-        _MaximumType = {
+    _MaximumType = {
         Bool :  Int64,
-
+     
         Int8  : Int64,
         Int16 : Int64,
         Int32 : Int64,
         Int64 : Int64,
-
+     
         UInt8  : Int64,
         UInt16 : Int64,
         UInt32 : Int64,
         UInt8  : Int64,
-
+     
         Float32 : Float64,
         Float64 : Float64,
-
+     
         Complex32 : Complex64,
         Complex64 : Complex64
         }

Modified: branches/numpy.scons/numpy/oldnumeric/arrayfns.py
===================================================================
--- branches/numpy.scons/numpy/oldnumeric/arrayfns.py	2007-11-13 13:10:59 UTC (rev 4450)
+++ branches/numpy.scons/numpy/oldnumeric/arrayfns.py	2007-11-13 13:51:35 UTC (rev 4451)
@@ -94,5 +94,3 @@
 
 def construct3(mask, itype):
     raise NotImplementedError
-
-

Modified: branches/numpy.scons/numpy/oldnumeric/ma.py
===================================================================
--- branches/numpy.scons/numpy/oldnumeric/ma.py	2007-11-13 13:10:59 UTC (rev 4450)
+++ branches/numpy.scons/numpy/oldnumeric/ma.py	2007-11-13 13:51:35 UTC (rev 4451)
@@ -12,4 +12,3 @@
 
 def take(a, indices, axis=0):
     return nca.average(a, indices, axis=0)
-

Modified: branches/numpy.scons/numpy/oldnumeric/matrix.py
===================================================================
--- branches/numpy.scons/numpy/oldnumeric/matrix.py	2007-11-13 13:10:59 UTC (rev 4450)
+++ branches/numpy.scons/numpy/oldnumeric/matrix.py	2007-11-13 13:51:35 UTC (rev 4451)
@@ -2,7 +2,6 @@
 
 __all__ = ['UserArray', 'squeeze', 'Matrix', 'asarray', 'dot', 'k', 'Numeric', 'LinearAlgebra', 'identity', 'multiply', 'types', 'string']
 
-import string
 import types
 from user_array import UserArray, asarray
 import numpy.oldnumeric as Numeric
@@ -17,7 +16,7 @@
     _table[k] = chr(k)
 _table = ''.join(_table)
 
-_numchars = string.digits + ".-+jeEL"
+_numchars = '0123456789.-+jeEL'
 _todelete = []
 for k in _table:
     if k not in _numchars:

Modified: branches/numpy.scons/numpy/oldnumeric/precision.py
===================================================================
--- branches/numpy.scons/numpy/oldnumeric/precision.py	2007-11-13 13:10:59 UTC (rev 4450)
+++ branches/numpy.scons/numpy/oldnumeric/precision.py	2007-11-13 13:51:35 UTC (rev 4451)
@@ -7,8 +7,8 @@
            'PrecisionError', 'PyObject', 'Int', 'UInt',
            'UnsignedInteger', 'string', 'typecodes', 'zeros']
 
-import string
 from functions import zeros
+import string   # for backwards compatibility
 
 typecodes = {'Character':'c', 'Integer':'bhil', 'UnsignedInteger':'BHI', 'Float':'fd', 'Complex':'FD'}
 

Modified: branches/numpy.scons/numpy/oldnumeric/random_array.py
===================================================================
--- branches/numpy.scons/numpy/oldnumeric/random_array.py	2007-11-13 13:10:59 UTC (rev 4450)
+++ branches/numpy.scons/numpy/oldnumeric/random_array.py	2007-11-13 13:51:35 UTC (rev 4451)
@@ -81,13 +81,13 @@
     """multivariate_normal(mean, cov) or multivariate_normal(mean, cov, [m, n, ...])
     returns an array containing multivariate normally distributed random numbers
     with specified mean and covariance.
-    
+
     mean must be a 1 dimensional array. cov must be a square two dimensional
     array with the same number of rows and columns as mean has elements.
-    
+
     The first form returns a single 1-D array containing a multivariate
     normal.
-    
+
     The second form returns an array of shape (m, n, ..., cov.shape[0]).
     In this case, output[i,j,...,:] is a 1-D array containing a multivariate
     normal."""
@@ -117,7 +117,7 @@
 def F(dfn, dfd, shape=[]):
     """F(dfn, dfd) or F(dfn, dfd, [n, m, ...]) returns array of F distributed random numbers with dfn degrees of freedom in the numerator and dfd degrees of freedom in the denominator."""
     if shape == []:
-        shape == None
+        shape = None
     return mt.f(dfn, dfd, shape)
 
 def noncentral_F(dfn, dfd, nconc, shape=[]):

Modified: branches/numpy.scons/numpy/random/tests/test_random.py
===================================================================
--- branches/numpy.scons/numpy/random/tests/test_random.py	2007-11-13 13:10:59 UTC (rev 4450)
+++ branches/numpy.scons/numpy/random/tests/test_random.py	2007-11-13 13:51:35 UTC (rev 4451)
@@ -2,7 +2,7 @@
 from numpy import random
 import numpy as N
 
-class test_multinomial(NumpyTestCase):
+class TestMultinomial(NumpyTestCase):
     def test_basic(self):
         random.multinomial(100, [0.2, 0.8])
 

Modified: branches/numpy.scons/numpy/testing/numpytest.py
===================================================================
--- branches/numpy.scons/numpy/testing/numpytest.py	2007-11-13 13:10:59 UTC (rev 4450)
+++ branches/numpy.scons/numpy/testing/numpytest.py	2007-11-13 13:51:35 UTC (rev 4451)
@@ -257,7 +257,7 @@
 
     Old-style test_suite(level=1) hooks are also supported.
     """
-    _check_testcase_name = re.compile(r'test.*').match
+    _check_testcase_name = re.compile(r'test.*|Test.*').match
     def check_testcase_name(self, name):
         """ Return True if name matches TestCase class.
         """
@@ -296,10 +296,10 @@
     def rename(self, **kws):
         """Apply renaming submodule test file test_<name>.py to
         test_<newname>.py.
-        
+
         Usage: self.rename(name='newname') before calling the
         self.test() method.
-        
+
         If 'newname' is None, then no tests will be executed for a given
         module.
         """

Modified: branches/numpy.scons/numpy/tests/test_ctypeslib.py
===================================================================
--- branches/numpy.scons/numpy/tests/test_ctypeslib.py	2007-11-13 13:10:59 UTC (rev 4450)
+++ branches/numpy.scons/numpy/tests/test_ctypeslib.py	2007-11-13 13:51:35 UTC (rev 4451)
@@ -4,7 +4,7 @@
 from numpy.ctypeslib import ndpointer
 restore_path()
 
-class test_ndpointer(NumpyTestCase):
+class TestNdpointer(NumpyTestCase):
     def check_dtype(self):
         dt = N.intc
         p = ndpointer(dtype=dt)

Modified: branches/numpy.scons/numpy/version.py
===================================================================
--- branches/numpy.scons/numpy/version.py	2007-11-13 13:10:59 UTC (rev 4450)
+++ branches/numpy.scons/numpy/version.py	2007-11-13 13:51:35 UTC (rev 4451)
@@ -1,4 +1,4 @@
-version='1.0.4'
+version='1.0.5'
 release=False
 
 if not release:

Deleted: branches/numpy.scons/scipy_compatibility
===================================================================
--- branches/numpy.scons/scipy_compatibility	2007-11-13 13:10:59 UTC (rev 4450)
+++ branches/numpy.scons/scipy_compatibility	2007-11-13 13:51:35 UTC (rev 4451)
@@ -1,4 +0,0 @@
-Changed names and behaviors in limits
-Changed usage of types
-Moved around some names
-Moved scimath functions to numpy.math

Deleted: branches/numpy.scons/setup.old.py
===================================================================
--- branches/numpy.scons/setup.old.py	2007-11-13 13:10:59 UTC (rev 4450)
+++ branches/numpy.scons/setup.old.py	2007-11-13 13:51:35 UTC (rev 4451)
@@ -1,90 +0,0 @@
-#!/usr/bin/env python
-"""NumPy: array processing for numbers, strings, records, and objects.
-
-NumPy is a general-purpose array-processing package designed to
-efficiently manipulate large multi-dimensional arrays of arbitrary
-records without sacrificing too much speed for small multi-dimensional
-arrays.  NumPy is built on the Numeric code base and adds features
-introduced by numarray as well as an extended C-API and the ability to
-create arrays of arbitrary type which also makes NumPy suitable for
-interfacing with general-purpose data-base applications.
-
-There are also basic facilities for discrete fourier transform,
-basic linear algebra and random number generation.
-"""
-
-DOCLINES = __doc__.split("\n")
-
-import os
-import sys
-
-CLASSIFIERS = """\
-Development Status :: 4 - Beta
-Intended Audience :: Science/Research
-Intended Audience :: Developers
-License :: OSI Approved
-Programming Language :: C
-Programming Language :: Python
-Topic :: Software Development
-Topic :: Scientific/Engineering
-Operating System :: Microsoft :: Windows
-Operating System :: POSIX
-Operating System :: Unix
-Operating System :: MacOS
-"""
-
-# BEFORE importing distutils, remove MANIFEST. distutils doesn't properly
-# update it when the contents of directories change.
-if os.path.exists('MANIFEST'): os.remove('MANIFEST')
-
-def configuration(parent_package='',top_path=None):
-    from numpy.distutils.misc_util import Configuration
-
-    config = Configuration(None, parent_package, top_path)
-    config.set_options(ignore_setup_xxx_py=True,
-                       assume_default_configuration=True,
-                       delegate_options_to_subpackages=True,
-                       quiet=True)
-    
-    config.add_subpackage('numpy')
-        
-    config.add_data_files(('numpy','*.txt'),
-                          ('numpy','COMPATIBILITY'),
-                          ('numpy','scipy_compatibility'), 
-                          ('numpy','site.cfg.example'))
-
-    config.get_version('numpy/version.py') # sets config.version
-
-    return config
-
-def setup_package():
-
-    from numpy.distutils.core import setup
-
-    old_path = os.getcwd()
-    local_path = os.path.dirname(os.path.abspath(sys.argv[0]))
-    os.chdir(local_path)
-    sys.path.insert(0,local_path)
-
-    try:
-        setup(
-            name = 'numpy',
-            maintainer = "NumPy Developers",
-            maintainer_email = "numpy-discussion@lists.sourceforge.net",
-            description = DOCLINES[0],
-            long_description = "\n".join(DOCLINES[2:]),
-            url = "http://numeric.scipy.org",
-            download_url = "http://sourceforge.net/project/showfiles.php?group_id=1369&package_id=175103",
-            license = 'BSD',
-            classifiers=filter(None, CLASSIFIERS.split('\n')),
-            author = "Travis E. Oliphant, et.al.",
-            author_email = "oliphant@ee.byu.edu",
-            platforms = ["Windows", "Linux", "Solaris", "Mac OS-X", "Unix"],            
-            configuration=configuration )
-    finally:
-        del sys.path[0]
-        os.chdir(old_path)
-    return
-
-if __name__ == '__main__':
-    setup_package()

Deleted: branches/numpy.scons/setup.py
===================================================================
--- branches/numpy.scons/setup.py	2007-11-13 13:10:59 UTC (rev 4450)
+++ branches/numpy.scons/setup.py	2007-11-13 13:51:35 UTC (rev 4451)
@@ -1,90 +0,0 @@
-#!/usr/bin/env python
-"""NumPy: array processing for numbers, strings, records, and objects.
-
-NumPy is a general-purpose array-processing package designed to
-efficiently manipulate large multi-dimensional arrays of arbitrary
-records without sacrificing too much speed for small multi-dimensional
-arrays.  NumPy is built on the Numeric code base and adds features
-introduced by numarray as well as an extended C-API and the ability to
-create arrays of arbitrary type which also makes NumPy suitable for
-interfacing with general-purpose data-base applications.
-
-There are also basic facilities for discrete fourier transform,
-basic linear algebra and random number generation.
-"""
-
-DOCLINES = __doc__.split("\n")
-
-import os
-import sys
-
-CLASSIFIERS = """\
-Development Status :: 4 - Beta
-Intended Audience :: Science/Research
-Intended Audience :: Developers
-License :: OSI Approved
-Programming Language :: C
-Programming Language :: Python
-Topic :: Software Development
-Topic :: Scientific/Engineering
-Operating System :: Microsoft :: Windows
-Operating System :: POSIX
-Operating System :: Unix
-Operating System :: MacOS
-"""
-
-# BEFORE importing distutils, remove MANIFEST. distutils doesn't properly
-# update it when the contents of directories change.
-if os.path.exists('MANIFEST'): os.remove('MANIFEST')
-
-def configuration(parent_package='',top_path=None):
-    from numpy.distutils.misc_util import Configuration
-
-    config = Configuration(None, parent_package, top_path, setup_name = 'setupscons.py')
-    config.set_options(ignore_setup_xxx_py=True,
-                       assume_default_configuration=True,
-                       delegate_options_to_subpackages=True,
-                       quiet=True)
-    
-    config.add_subpackage('numpy')
-        
-    config.add_data_files(('numpy','*.txt'),
-                          ('numpy','COMPATIBILITY'),
-                          ('numpy','scipy_compatibility'), 
-                          ('numpy','site.cfg.example'))
-
-    config.get_version('numpy/version.py') # sets config.version
-
-    return config
-
-def setup_package():
-
-    from numpy.distutils.core import setup
-
-    old_path = os.getcwd()
-    local_path = os.path.dirname(os.path.abspath(sys.argv[0]))
-    os.chdir(local_path)
-    sys.path.insert(0,local_path)
-
-    try:
-        setup(
-            name = 'numpy',
-            maintainer = "NumPy Developers",
-            maintainer_email = "numpy-discussion@lists.sourceforge.net",
-            description = DOCLINES[0],
-            long_description = "\n".join(DOCLINES[2:]),
-            url = "http://numeric.scipy.org",
-            download_url = "http://sourceforge.net/project/showfiles.php?group_id=1369&package_id=175103",
-            license = 'BSD',
-            classifiers=filter(None, CLASSIFIERS.split('\n')),
-            author = "Travis E. Oliphant, et.al.",
-            author_email = "oliphant@ee.byu.edu",
-            platforms = ["Windows", "Linux", "Solaris", "Mac OS-X", "Unix"],            
-            configuration=configuration )
-    finally:
-        del sys.path[0]
-        os.chdir(old_path)
-    return
-
-if __name__ == '__main__':
-    setup_package()

Copied: branches/numpy.scons/setup.py (from rev 4450, branches/numpy.scons/setup.old.py)

Copied: branches/numpy.scons/setupscons.py (from rev 4450, branches/numpy.scons/setup.py)

Modified: branches/numpy.scons/test.sh
===================================================================
--- branches/numpy.scons/test.sh	2007-11-13 13:10:59 UTC (rev 4450)
+++ branches/numpy.scons/test.sh	2007-11-13 13:51:35 UTC (rev 4451)
@@ -1,5 +1,5 @@
 PREFIX=$PWD
 rm -rf $PREFIX/build
 rm -rf $PREFIX/tmp
-DEBUG_SCONS_CHECK=0 python setup.py scons --jobs=1 install --prefix=$PREFIX/tmp
-(cd $PREFIX/tmp && PYTHONPATH=$PREFIX/tmp/lib/python2.4/site-packages python -c "import numpy; print numpy; numpy.test(level = 9999); numpy.show_config()")
+MKL=None python setup.py scons --jobs=4 install --prefix=$PREFIX/tmp
+(cd $PREFIX/tmp && PYTHONPATH=$PREFIX/tmp/lib/python2.5/site-packages python -c "import numpy; print numpy; numpy.test(level = 9999); numpy.show_config()")



More information about the Numpy-svn mailing list