[Python-checkins] python/dist/src/Lib sets.py,1.19,1.20

rhettinger@users.sourceforge.net rhettinger@users.sourceforge.net
Sat, 24 Aug 2002 00:33:08 -0700


Update of /cvsroot/python/python/dist/src/Lib
In directory usw-pr-cvs1:/tmp/cvs-serv8853/lib

Modified Files:
	sets.py 
Log Message:
Removed < <= > >= from the API.  Implemented as comparisons of the 
underlying dictionaries, there were no reasonable use cases (lexicographic
sorting of a list of sets is somewhat esoteric).  Frees the operators
for other uses (such as strict subset and superset comparisons).

Updated documentation and test suite accordingly.



Index: sets.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/sets.py,v
retrieving revision 1.19
retrieving revision 1.20
diff -C2 -d -r1.19 -r1.20
*** sets.py	24 Aug 2002 06:19:02 -0000	1.19
--- sets.py	24 Aug 2002 07:33:06 -0000	1.20
***************
*** 103,116 ****
          return self._data.iterkeys()
  
!     # Comparisons.  Ordering is determined by the ordering of the
!     # underlying dicts (which is consistent though unpredictable).
! 
!     def __lt__(self, other):
!         self._binary_sanity_check(other)
!         return self._data < other._data
! 
!     def __le__(self, other):
!         self._binary_sanity_check(other)
!         return self._data <= other._data
  
      def __eq__(self, other):
--- 103,107 ----
          return self._data.iterkeys()
  
!     # Equality comparisons using the underlying dicts
  
      def __eq__(self, other):
***************
*** 121,132 ****
          self._binary_sanity_check(other)
          return self._data != other._data
- 
-     def __gt__(self, other):
-         self._binary_sanity_check(other)
-         return self._data > other._data
- 
-     def __ge__(self, other):
-         self._binary_sanity_check(other)
-         return self._data >= other._data
  
      # Copying operations
--- 112,115 ----