On May 11, 2015 12:44 PM, "Alan G Isaac" <alan.is...@gmail.com> wrote: > > On 5/9/2015 4:26 PM, Nathaniel Smith wrote: > > 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 @ (which are that this case should be an > > error). > > Do I recall incorrectly: I thought that reconciliation of `@` and `dot` > was explicitly not part of the project on getting a `@` operator? > > I do not mean this to speak for or against the change above, which I only > moderately oppose, but rather to the argument offered.
Not sure what you mean. It's true that PEP 465 doesn't say anything about np.dot, because it's out of scope. The argument here, though, is not "PEP 465 says we have to do this". It's that it's confusing to have two different subtly different sets of semantics, and the PEP semantics are better (that's why we chose them), so we should at a minimum warn people who are getting the old behavior > As for the "logic" of the current behavior, can it not be given a > tensor product motivation? (Otoh, it conflicts with the current > behavior of `vdot`.) Maybe? I don't know of any motivation that doesn't require treating it as a special case added only to duplicate existing behavior, but that doesn't mean one doesnt exist... -n
_______________________________________________ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion