Ejemplo n.º 1
0
 def __eq__(self, that):
   if len(self) != len(that):
     return False
   if isinstance(that, SortedSet):
     return (self._list == that._list)
   elif isinstance(that, set):
     return (self._set == that)
   else:
     _set = self._set
     return all(val in _set for val in that)
Ejemplo n.º 2
0
 def __eq__(self, that):
     if len(self) != len(that):
         return False
     if isinstance(that, SortedSet):
         return (self._list == that._list)
     elif isinstance(that, set):
         return (self._set == that)
     else:
         _set = self._set
         return all(val in _set for val in that)
Ejemplo n.º 3
0
 def __ge__(self, that):
   return ((len(self) >= len(that))
       and all(lhs >= rhs for lhs, rhs in zip(self, that)))
Ejemplo n.º 4
0
 def __le__(self, that):
   return ((len(self) <= len(that))
       and all(lhs <= rhs for lhs, rhs in zip(self, that)))
Ejemplo n.º 5
0
 def __eq__(self, that):
   return ((len(self) == len(that))
       and all(lhs == rhs for lhs, rhs in zip(self, that)))
Ejemplo n.º 6
0
 def __eq__(self, that):
   return (len(self._dict) == len(that)
       and all((key in that) and (self[key] == that[key])
           for key in self))
Ejemplo n.º 7
0
 def __le__(self, that):
   if isinstance(that, set):
     return (self._set <= that)
   else:
     return all(val in that for val in self._list)
Ejemplo n.º 8
0
 def __gt__(self, that):
   if isinstance(that, set):
     return (self._set > that)
   else:
     _set = self._set
     return (len(self) > len(that)) and all(val in _set for val in that)
Ejemplo n.º 9
0
 def __lt__(self, that):
   if isinstance(that, set):
     return (self._set < that)
   else:
     return (len(self) < len(that)) and all(val in that for val in self._list)
Ejemplo n.º 10
0
 def __ge__(self, that):
   if isinstance(that, set):
     return (self._set >= that)
   else:
     _set = self._set
     return all(val in _set for val in that)
Ejemplo n.º 11
0
 def __eq__(self, that):
     return (len(self._dict) == len(that) and all(
         (key in that) and (self[key] == that[key]) for key in self))
Ejemplo n.º 12
0
 def __lt__(self, that):
     if isinstance(that, set):
         return (self._set < that)
     else:
         return (len(self) < len(that)) and all(val in that
                                                for val in self._list)
Ejemplo n.º 13
0
 def __ge__(self, that):
     if isinstance(that, set):
         return (self._set >= that)
     else:
         _set = self._set
         return all(val in _set for val in that)
Ejemplo n.º 14
0
 def __le__(self, that):
     if isinstance(that, set):
         return (self._set <= that)
     else:
         return all(val in that for val in self._list)
Ejemplo n.º 15
0
 def __gt__(self, that):
     if isinstance(that, set):
         return (self._set > that)
     else:
         _set = self._set
         return (len(self) > len(that)) and all(val in _set for val in that)