3 ms·
But there are times you want heterogenous types to compare with ==. Your approach isn't compatible with ad-hoc polymorphism. For an example, consider `np.eye(4
by joshuamorton 6y ago
But there are times you want heterogenous types to compare with ==. Your approach isn't compatible with ad-hoc polymorphism.
For an example, consider `np.eye(4) == 1`. In this, you're comparing a doubly nested array of floats with a scalar int, but the operation is well defined (vectorized equality comparison).
And yes, it should be feasible to typecheck that operation.