Commit cf653bd3 authored by Martin Reinecke's avatar Martin Reinecke
Browse files

doc tweaks

parent 50c56bdd
Pipeline #24645 passed with stage
in 22 minutes and 32 seconds
...@@ -35,13 +35,20 @@ class Domain(with_metaclass( ...@@ -35,13 +35,20 @@ class Domain(with_metaclass(
raise NotImplementedError raise NotImplementedError
def __hash__(self): def __hash__(self):
"""Returns a hash value for the object.
Notes
-----
Only members that are explicitly added to
:py:attr:`._needed_for_hash` will be used for hashing.
"""
result_hash = 0 result_hash = 0
for key in self._needed_for_hash: for key in self._needed_for_hash:
result_hash ^= hash(vars(self)[key]) result_hash ^= hash(vars(self)[key])
return result_hash return result_hash
def __eq__(self, x): def __eq__(self, x):
"""Checks if two domains are equal. """Checks whether two domains are equal.
Parameters Parameters
---------- ----------
...@@ -62,6 +69,7 @@ class Domain(with_metaclass( ...@@ -62,6 +69,7 @@ class Domain(with_metaclass(
return True return True
def __ne__(self, x): def __ne__(self, x):
"""Returns the opposite of :py:meth:`.__eq__()`"""
return not self.__eq__(x) return not self.__eq__(x)
@abc.abstractproperty @abc.abstractproperty
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment