I want to overload the operator @
in python for a class I have written. I know how to do operator overloading in general (i.e. by defining __add__
and __radd__
to overload +
) but I could not find a way to overload @
.
Why I know, that @
can be overloaded: for numpy arrays, A@B
gives the matrix product of A
and B
, while A*B
gives the Hadamard (element-wise) product.