[Numpy-discussion] Removing deprecated names

Ed Schofield schofield at ftw.at
Sun Jun 4 13:02:17 EDT 2006

Hi all,

I've created four patches to remove deprecated names from the  
numpy.core and numpy namespaces by default.  The motivation for this  
is to provide a clear separation for both new users and users  
migrating from Numeric between those names that are deprecated and  
those that are recommended.

The first patch cleans up NumPy to avoid the use of deprecated names  


The second patch separates the Numeric-like function interfaces,  
which Travis has said he doesn't want to deprecate, from the other  
names in oldnumeric.py, which include the capitalized type names,  
arrayrange, matrixmultiply, outerproduct, NewAxis, and a few others:


The third patch removes the deprecated names from the numpy.core and  
numpy namespaces and adds a compatibility function, numpy.Numeric(),  
that imports the deprecated interfaces into the namespace as before:


The fourth patch (also in ticket #139) is a script that adds the line  
"numpy.Numeric()" to the appropriate place in all Python files in the  
specified directory.  I've tested this on the SciPy source tree,  
which still uses the old Numeric interfaces in many places.  After  
running the script, SciPy runs all its 1518 unit tests without errors.

These patches make a fairly small difference to the size of NumPy's  
default namespace:

 >>> import numpy
 >>> len(dir(numpy))
 >>> numpy.Numeric()
 >>> len(dir(numpy))

They do, however, help to support Python principle #13 ...

-- Ed

More information about the NumPy-Discussion mailing list