4 ms·
I don't get why they don't just let * do matrix multiplication on matrices, and introduce .* for element-wise multiplication.
by ak217 13y ago
I don't get why they don't just let * do matrix multiplication on matrices, and introduce .* for element-wise multiplication.
- dagw 13y agoBecause * has been element-wise multiplication in python numeric/numpy since the python 1.0 days. Introducing such a massive and fundamental backwards incompatible syntax change just as python 3 is starting to settle down and slowly gaining acceptance is probably not a good idea
- ak217 13y agoGreat point, I forgot about that. In that case, I wish they'd used * * * or something. @ just doesn't seem right to me.
- pekk 13y agoThis is a problem for python numeric/numpy, not Python. Let them fix their own problems
- dragonwriter 13y agoThe change being made to python exists to enable the fix preferred by much of the community to the API fragmentation problem that exists among python numeric libraries given the need for both convenient matrix multiplicationa and convenient elementwise multiplication. Since its a fairly dominant application area that is pretty key for Python (there's a reason there are so many bundled python distributions that include the common scientific/numeric libraries, and that those environments are often chosen as pedagogical tools even for general-purpose programming), making a fairly modest language-level change to enable a clean resolution to this fragmentation is a sensible thing to do.