On 4/1/17, Franklin? Lee <leewangzhong+pyt...@gmail.com> wrote:
> On Fri, Mar 31, 2017 at 3:58 AM, Chris Angelico <ros...@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.
_______________________________________________
Python-ideas mailing list
Python-ideas@python.org
https://mail.python.org/mailman/listinfo/python-ideas
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to