Live data from Hacker News

PEP 465 – Dedicated infix operators for matrix multiplication and matrix power

python.org

41–42 of 42 posts

Re: PEP 465 – Dedicated infix operators for matrix multiplication and matrix power

#41
post #32
post #31

Earlier quoted context omitted.

It does away with the need for a separate matrix type. When you are using numpy (most imported non stdlib library according to the pep!) and you have two arrays a and b, a * b is elementwise multiplication. numpy currently has a matrix type. When a and b are both matrices, a * b is matrix multiplication. The @ operator would do away with the need for a matrix type. Then, a * b is element wise and a @ b is matrix wise…

"The @ operator would do away for a matrix type" which is only an issue because every lib needs to define its own matrix type ? Then why isn't the solution to provide this type in the standard lib ?

It doesn't have to be used for matrix multiplication. Other libraries might overload it as something else.

Re: PEP 465 – Dedicated infix operators for matrix multiplication and matrix power

#42
post #40
post #39

Earlier quoted context omitted.

> NumPy is a crappily designed library I don't think you know what you're talking about.

Try Eigen, you'll agree that NumPy is an array library that had linear algebra support thrown in as an afterthought.

Of course it's an array library. The fact that it's not designed for your problem doesn't mean it's designed crappily.

Suppose you ported Eigen to Python. You'd still need an array library, so you could represent the inputs and outputs in a way that's usable in Python. You'd probably use NumPy.

Post reply on HN