
July 5, 2023
10:02 a.m.
Python has the "star" ("*") operator for multiplication. In the context of collections it is supposed to mean element-wise multiplication. Its associated operator is __mul__. It also has the double star ("**") operator for exponentiation, which is repeated multiplication. Its associated operator is __exp__.In addition to that Python has the "at" ("@") operator for multiplication. In the context of collections it should mean linear product, like matrix times a matrix, or matrix times vector. Its associated method is __matmul__.For completeness we should now have the exponentiation operator meaning repeated application of the "at" operator. Its method could me __matexp__.