Should the keyword argument dtype
is not considered in np.equal
?
In the function documentation, it seems to indicate that dtype
should a valid keyword argument, and I couldn't find anything saying that it will be ignored, but when using logical ufuncs, it does not seem to be used:
>>> import numpy as np
>>> np.__version__
'1.14.2'
>>> a = b = np.arange(2).astype(np.uint8)
>>> np.equal(a, b, dtype=float).dtype
dtype('bool')
>>> np.add(a, b).dtype
dtype('uint8')
>>> np.add(a, b, dtype=float).dtype
dtype('float64')
I would expect any ufunc to have the same output type if the return dtype is specified, but np.add
behaves as I expected, while np.equal
does not. Is this behavior intended?