
April 1, 2017
5:22 a.m.
On 4/1/17, Franklin? Lee <leewangzhong+python@gmail.com> wrote:
On Fri, Mar 31, 2017 at 3:58 AM, Chris Angelico <rosuav@gmail.com> wrote:
This keeps on coming up in one form or another - either someone multiplies a list of lists and ends up surprised that they're all the same, or is frustrated with the verbosity of the alternatives.
Can we use the matmul operator for this?
In math, a number can be considered a 1-dimensional vector. You can multiply a 1-dimensional vector by an n-dimensional vector _as matrices_ to get the same result as scalar multiplication. Using it as a deep-copy multiplication operator might make things confusing when someone moves to or from Numpy.
Too late. ;) [1, 1, 1] * 3 numpy.ones(3) * 3 PL.