[Numpy-svn] r3673 - trunk/numpy/core

numpy-svn@scip... numpy-svn@scip...
Thu Apr 5 19:11:04 CDT 2007


Author: oliphant
Date: 2007-04-05 19:11:02 -0500 (Thu, 05 Apr 2007)
New Revision: 3673

Modified:
   trunk/numpy/core/numerictypes.py
Log:
Fix maximum_sctype for integer data-types.

Modified: trunk/numpy/core/numerictypes.py
===================================================================
--- trunk/numpy/core/numerictypes.py	2007-04-05 22:20:15 UTC (rev 3672)
+++ trunk/numpy/core/numerictypes.py	2007-04-06 00:11:02 UTC (rev 3673)
@@ -315,8 +315,13 @@
         _add_array_type('complex', 2*bits)
     _gi = dtype('p')
     if _gi.type not in sctypes['int']:
-        sctypes['int'].append(_gi.type)
-        sctypes['uint'].append(dtype('P').type)
+        indx = 0
+        sz = _gi.itemsize
+        _lst = sctypes['int']
+        while (indx < len(_lst) and sz >= _lst[indx](0).itemsize):
+            indx += 1
+        sctypes['int'].insert(indx, _gi.type)
+        sctypes['uint'].insert(indx, dtype('P').type)
 _set_array_types()
 
 



More information about the Numpy-svn mailing list