Commits

Alex Gaynor committed a33b00b

rtruediv on numpy boxes

Comments (0)

Files changed (2)

pypy/module/micronumpy/interp_boxes.py

     descr_rsub = _binop_right_impl("subtract")
     descr_rmul = _binop_right_impl("multiply")
     descr_rdiv = _binop_right_impl("divide")
+    descr_rtruediv = _binop_right_impl("true_divide")
     descr_rmod = _binop_right_impl("mod")
     descr_rpow = _binop_right_impl("power")
     descr_rlshift = _binop_right_impl("left_shift")
     __rsub__ = interp2app(W_GenericBox.descr_rsub),
     __rmul__ = interp2app(W_GenericBox.descr_rmul),
     __rdiv__ = interp2app(W_GenericBox.descr_rdiv),
+    __rtruediv__ = interp2app(W_GenericBox.descr_rtruediv),
     __rmod__ = interp2app(W_GenericBox.descr_rmod),
     __rdivmod__ = interp2app(W_GenericBox.descr_rdivmod),
     __rpow__ = interp2app(W_GenericBox.descr_rpow),

pypy/module/micronumpy/test/test_dtypes.py

 
         assert 5 / int_(2) == int_(2)
         assert truediv(int_(3), int_(2)) == float64(1.5)
+        assert truediv(3, int_(2)) == float64(1.5)
         assert int_(8) % int_(3) == int_(2)
         assert 8 % int_(3) == int_(2)
         assert divmod(int_(8), int_(3)) == (int_(2), int_(2))
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.