I'm just curious about how numpy implements its scalar multiplication. In my understanding,
x * y calls the __mul__ method of x, x.__mul__(y).
How would this work with this code:
x = 6
y = np.array([1,2])
print(x * y)
Wouldn't the code call x.__mul__(y)? And since x is not a numpy variable, how does numpy have any control over how this behaves?