コード例 #1
0
ファイル: sortedset.py プロジェクト: abgoyal/pts-mini-gpl
 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)
コード例 #2
0
ファイル: sortedset.py プロジェクト: pts/pybasealgo
 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)
コード例 #3
0
 def __ge__(self, that):
   return ((len(self) >= len(that))
       and all(lhs >= rhs for lhs, rhs in zip(self, that)))
コード例 #4
0
 def __le__(self, that):
   return ((len(self) <= len(that))
       and all(lhs <= rhs for lhs, rhs in zip(self, that)))
コード例 #5
0
 def __eq__(self, that):
   return ((len(self) == len(that))
       and all(lhs == rhs for lhs, rhs in zip(self, that)))
コード例 #6
0
ファイル: sorteddict.py プロジェクト: abgoyal/pts-mini-gpl
 def __eq__(self, that):
   return (len(self._dict) == len(that)
       and all((key in that) and (self[key] == that[key])
           for key in self))
コード例 #7
0
ファイル: sortedset.py プロジェクト: abgoyal/pts-mini-gpl
 def __le__(self, that):
   if isinstance(that, set):
     return (self._set <= that)
   else:
     return all(val in that for val in self._list)
コード例 #8
0
ファイル: sortedset.py プロジェクト: abgoyal/pts-mini-gpl
 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)
コード例 #9
0
ファイル: sortedset.py プロジェクト: abgoyal/pts-mini-gpl
 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)
コード例 #10
0
ファイル: sortedset.py プロジェクト: abgoyal/pts-mini-gpl
 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)
コード例 #11
0
ファイル: sorteddict.py プロジェクト: pts/pybasealgo
 def __eq__(self, that):
     return (len(self._dict) == len(that) and all(
         (key in that) and (self[key] == that[key]) for key in self))
コード例 #12
0
ファイル: sortedset.py プロジェクト: pts/pybasealgo
 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)
コード例 #13
0
ファイル: sortedset.py プロジェクト: pts/pybasealgo
 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)
コード例 #14
0
ファイル: sortedset.py プロジェクト: pts/pybasealgo
 def __le__(self, that):
     if isinstance(that, set):
         return (self._set <= that)
     else:
         return all(val in that for val in self._list)
コード例 #15
0
ファイル: sortedset.py プロジェクト: pts/pybasealgo
 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)