I'm trying to create a custom hashing function for strings. I want to hash strings by their character frequency by weight. So that hi
and ih
will yield the same hash. Can I override __hash__
?
Or is creating a wrapper class that holds the string and overriding __hash__
and __eq__
the only way?