[Numpy-svn] r8238 - in trunk/numpy/core: code_generators src/umath

numpy-svn at scipy.org numpy-svn at scipy.org
Sun Feb 21 06:59:06 EST 2010


Author: ptvirtan
Date: 2010-02-21 05:59:06 -0600 (Sun, 21 Feb 2010)
New Revision: 8238

Modified:
   trunk/numpy/core/code_generators/generate_umath.py
   trunk/numpy/core/src/umath/umathmodule.c.src
Log:
3K: BUG: alias divide -> true_divide correctly; just replacing the name in generate_umath.py is not the correct thing to do

Modified: trunk/numpy/core/code_generators/generate_umath.py
===================================================================
--- trunk/numpy/core/code_generators/generate_umath.py	2010-02-21 11:58:38 UTC (rev 8237)
+++ trunk/numpy/core/code_generators/generate_umath.py	2010-02-21 11:59:06 UTC (rev 8238)
@@ -682,7 +682,8 @@
 }
 
 if sys.version_info[0] >= 3:
-    defdict['divide'] = defdict['true_divide']
+    # Will be aliased to true_divide in umathmodule.c.src:InitOtherOperators
+    del defdict['divide']
 
 def indent(st,spaces):
     indention = ' '*spaces

Modified: trunk/numpy/core/src/umath/umathmodule.c.src
===================================================================
--- trunk/numpy/core/src/umath/umathmodule.c.src	2010-02-21 11:58:38 UTC (rev 8237)
+++ trunk/numpy/core/src/umath/umathmodule.c.src	2010-02-21 11:59:06 UTC (rev 8238)
@@ -225,6 +225,12 @@
                                 "Compute y = x1 * 2**x2.",0);
     PyDict_SetItemString(dictionary, "ldexp", f);
     Py_DECREF(f);
+
+#if defined(NPY_PY3K)
+    f = PyDict_GetItemString(dictionary, "true_divide");
+    PyDict_SetItemString(dictionary, "divide", f);
+    Py_DECREF(f);
+#endif
     return;
 }
 




More information about the Numpy-svn mailing list