Closed
Description
I would like to know how to override generated methods in attrs. From the documentation is not clear.
My problem is that if I put some numpy arrays as values, the regular "==" operator fails because np.array_equal
should be used instead.
The error is the following:
def __eq__(self, other):
if other.__class__ is not self.__class__:
return NotImplemented
return (
self.raw,
self.processed,
) == (
other.raw,
> other.processed,
)
E ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()
Metadata
Metadata
Assignees
Labels
No labels