[Python-checkins] python/dist/src/Lib sets.py,1.8,1.9

gvanrossum@users.sourceforge.net gvanrossum@users.sourceforge.net
2002年8月20日 19:44:07 -0700


Update of /cvsroot/python/python/dist/src/Lib
In directory usw-pr-cvs1:/tmp/cvs-serv20120
Modified Files:
	sets.py 
Log Message:
Add Raymond H to the list of authors; add some XXX comments about
possible API improvements.
Index: sets.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/sets.py,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** sets.py	21 Aug 2002 02:22:08 -0000	1.8
--- sets.py	21 Aug 2002 02:44:04 -0000	1.9
***************
*** 52,55 ****
--- 52,58 ----
 # - Guido van Rossum rewrote much of the code, made some API changes,
 # and cleaned up the docstrings.
+ #
+ # - Raymond Hettinger implemented a number of speedups and other
+ # improvements.
 
 
***************
*** 68,71 ****
--- 71,75 ----
 # Don't call this from a concrete subclass!
 if self.__class__ is BaseSet:
+ # XXX Maybe raise TypeError instead, like basestring()?
 raise NotImplementedError, ("BaseSet is an abstract class. "
 "Use Set or ImmutableSet.")
***************
*** 286,289 ****
--- 290,295 ----
 def __init__(self, seq):
 """Construct an immutable set from a sequence."""
+ # XXX Maybe this should default seq to None?
+ # XXX Creating an empty immutable set is not unheard of.
 self._hashcode = None
 self._data = data = {}
***************
*** 297,300 ****
--- 303,309 ----
 # XXX Should this perhaps look for _as_immutable?
 # XXX If so, should use self.update(seq).
+ # XXX (Well, ImmutableSet doesn't have update(); the base
+ # XXX class could have _update() which does this though, and
+ # XXX we could use that here and in Set.update().)
 for key in seq:
 data[key] = value

AltStyle によって変換されたページ (->オリジナル) /