@ operator in python 3.5
Today I learned there is an operator "@" in python 3.5. If you just type 5 @ 5 in python REPL, you will see the next message
--------------------------------------------------------------------------- TypeError Traceback (most recent call last) <ipython-input-1-c59396881bea> in <module>() ----> 1 5 @ 5 TypeError: unsupported operand type(s) for @: 'int' and 'int'
New python syntax supports @ operator, however there are no built-in types which can be operands of this operators.
But numpy is.
There is a little example below:
import numpy as np
X = np.array([[1, 2, 3],
[1, 2, 3],
[1, 2, 3]])
X @ X
There is a very weird behaviour of pygments, it suggests "@" operator is a mistake, but don't care. As you might guess, @ is a matrix multiplication operator. However I suggest, that this is not the only thing for what this operator can be used.