scipy/scipy — pull request #2717 by larsmans (2013-08-12 16:12:44+00:00)
Title: ENH: allow sparse __rmul__ to work with custom types

While implementing a custom sparse matrix class (a fast replacement for `dok_matrix` in Cython/C++), I noticed that there's no way to make a `scipy.sparse` matrix multiply with my type on the right, because `__mul__` was raising a `ValueError` instead of returning `NotImplemented`. I fixed that and included a unit test.