### Proposed deprecations for 1.10: dot corner cases

2015-05-09 20:26:58 GMT

Hi all, I'd like to suggest that we go ahead and add deprecation warnings to the following operations. This doesn't commit us to changing anything on any particular time scale, but it gives us more options later. 1) dot(A, B) where A and B*both*have *3 or more dimensions*: currently, this does a weird "outer product" thing, where it computes all pairwise matrix products. We've had numerous discussions about why this is suboptimal, and it contradicts the PEP 465 semantics for <at> , which broadcast + vectorize over extra dimensions. (If you have a vectorized version, then the outer product one is easy to derive; if you have only the outer product version .) While dot() is widely used in general, this particular varient is very, very rarely used. I propose we issue a FutureWarning here, so as to lay the groundwork for someday eventually making dot() and <at> the same. 2) dot(A, B) where one of the argument is a scalar: currently, this does scalar multiplication. There is no logically consistent motivation for this, it violates TOOWTDI, and again it is inconsistent with the PEP semantics for <at> (which are that this case should be an error). (NB for those still using np.matrix: scalar * np.matrix will still be supported regardless; this would only affect expressions where you actually call the dot() function.) I propose to make this a DeprecationWarning. -- -- Nathaniel J. Smith -- http://vorpus.org