Closed mithrandi closed 8 years ago
My understanding is that if one implements eq, hash should always be implemented along with it.
I think it's the other way around: hashable objects must be comparable for equality, but objects comparable for equality do not necessarily need to be hashable. In particular mutable objects should not be hashable, but they can be comparable (eg. list
).
Right. PEM objects should be both.
I have a branch mostly done for this, but I'll wait until #24 is merged to PR it since there will be a bunch of stupid conflicts otherwise.
Being able to compare these for equality would make my tests simpler, among other things. I guess there's no reason not to implement
__hash__
at the same time?