[Numpy-svn] r8219 - trunk/numpy/ma

numpy-svn@scip... numpy-svn@scip...
Sat Feb 20 20:52:03 CST 2010


Author: ptvirtan
Date: 2010-02-20 20:52:02 -0600 (Sat, 20 Feb 2010)
New Revision: 8219

Modified:
   trunk/numpy/ma/core.py
Log:
3K: ma: implement __rtruediv__, __rfloordiv__, __rpow__ for masked arrays

Modified: trunk/numpy/ma/core.py
===================================================================
--- trunk/numpy/ma/core.py	2010-02-21 02:51:48 UTC (rev 8218)
+++ trunk/numpy/ma/core.py	2010-02-21 02:52:02 UTC (rev 8219)
@@ -3667,13 +3667,25 @@
         "Divide other into self, and return a new masked array."
         return true_divide(self, other)
     #
+    def __rtruediv__(self, other):
+        "Divide other into self, and return a new masked array."
+        return true_divide(other, self)
+    #
     def __floordiv__(self, other):
         "Divide other into self, and return a new masked array."
         return floor_divide(self, other)
     #
+    def __rfloordiv__(self, other):
+        "Divide other into self, and return a new masked array."
+        return floor_divide(other, self)
+    #
     def __pow__(self, other):
         "Raise self to the power other, masking the potential NaNs/Infs"
         return power(self, other)
+    #
+    def __rpow__(self, other):
+        "Raise self to the power other, masking the potential NaNs/Infs"
+        return power(other, self)
     #............................................
     def __iadd__(self, other):
         "Add other to self in-place."



More information about the Numpy-svn mailing list