- haskpy.typeclasses.hashable.Hashable
Hashable¶
- class Hashable[source]¶
Bases:
EqHashable typeclass
Minimal complete definition:
__hash__Similary as in PureScript,
Hashableis a subclass ofEq.- __annotations__ = {}¶
- __eq__(other)¶
Equality comparison:
Eq a => a -> a -> boolCan be used as
==operator.The default implementation uses
__ne__.
- __hash__()[source]¶
Mark method non-existing
This is a workaround for Python forcefully creating some methods. One cannot create objects that don’t have
__eq__,__ge__,__gt__and many other methods. They are there and it’s not possible to delete them. With this wrapper you can override those methods so that they won’t show up in__dir__listing and if accessed in any way,AttributeErroris raised. Note that it just hides the methods, one can still access them asobject.__getattribute__(obj, "__eq__").
- __ne__(other)¶
Inequality comparison:
Eq a => a -> a -> boolCan be used as
!=operator.The default implementation uses
__eq__.