logoalt Hacker News

datsci_est_2015today at 2:28 PM1 replyview on HN

One example is if an and b are arrays (e.g. numpy arrays) it’s not unreasonable for dunder eq to return an array of booleans.

Another example might be if you have a domain specific representation of equality (e.g. class Equality)


Replies

voidUpdatetoday at 2:31 PM

I can see the first one making sense, but why would you need a representation of equality other than "yes, these are equal" and "no, these are not equal"?

show 2 replies