Beispiel #1
0
 def __hash__(self):
     """Return a hash based on the value that is calculated on demand and cached."""
     if not self._hash:
         self._hash = _misc.get_hash(
             'algebraixlib.mathobjects.couplet.Couplet', self.left,
             self.right)
     return self._hash
Beispiel #2
0
 def __hash__(self):
     """Return a hash based on the value that is calculated on demand and cached."""
     if not self._hash:
         counter_parts = self.data.items()
         multiset_parts = ['algebraixlib.mathobjects.multiset.Multiset']
         # noinspection PyTypeChecker
         multiset_parts.extend(counter_parts)
         self._hash = _misc.get_hash(*multiset_parts)
     return self._hash
Beispiel #3
0
 def __hash__(self):
     """Return a hash based on the value that is calculated on demand and cached."""
     if not self._hash:
         counter_parts = self.data.items()
         multiset_parts = ['algebraixlib.mathobjects.multiset.Multiset']
         # noinspection PyTypeChecker
         multiset_parts.extend(counter_parts)
         self._hash = _misc.get_hash(*multiset_parts)
     return self._hash
Beispiel #4
0
 def __hash__(self):
     """Return a hash based on the member values. (It must match the implementation of `is_same`,
     to which `Structure.__eq__` redirects equality comparisons.) Is always cached.
     """
     return _misc.get_hash(_misc.get_full_class_name(self), self.base_set)
Beispiel #5
0
 def __hash__(self):
     """Return a hash based on the value that is calculated on demand and cached."""
     if not self._hash:
         self._hash = _misc.get_hash('algebraixlib.mathobjects.set.Set', self.data)
     return self._hash
Beispiel #6
0
 def __hash__(self):
     """Return a hash based on the member values. (It must match the implementation of `is_same`,
     to which `Structure.__eq__` redirects equality comparisons.) Is always cached.
     """
     return _misc.get_hash(_misc.get_full_class_name(self), self.base_set)
Beispiel #7
0
 def __hash__(self):
     """Return a hash based on the value that is calculated on demand and cached."""
     if not self._hash:
         self._hash = _misc.get_hash(
             'algebraixlib.mathobjects.couplet.Couplet', self.left, self.right)
     return self._hash