S
Simon Brunning
For the purposes of a little test utility that we use, I need an
object that evaluates as equal to anything. (I realise that this is a
bad idea in some ways, breaking the equals/hashcode invariant and so
forth, but I'm hoping that I can get away with it in this case.) It
seems a simple enough task at first:
.... def __eq__(self, other):
.... return True
....
I'm fairly sure that I know what is going on here - the left hand side
object is getting first stab at the equality test, and understandably,
it's saying "Nah". But is there anything that I can do about it?
object that evaluates as equal to anything. (I realise that this is a
bad idea in some ways, breaking the equals/hashcode invariant and so
forth, but I'm hoping that I can get away with it in this case.) It
seems a simple enough task at first:
.... def __eq__(self, other):
.... return True
....
FalseTrue
But...
I'm fairly sure that I know what is going on here - the left hand side
object is getting first stab at the equality test, and understandably,
it's saying "Nah". But is there anything that I can do about it?