[Zope3-checkins] CVS: Zope3/src/zodb - utils.py:1.5

Fred L. Drake, Jr. fred at zope.com
Fri Jan 23 16:58:20 EST 2004


Update of /cvs-repository/Zope3/src/zodb
In directory cvs.zope.org:/tmp/cvs-serv15286

Modified Files:
	utils.py 
Log Message:
remove Python 2.2 compatibility cruft since we require Python 2.3.3


=== Zope3/src/zodb/utils.py 1.4 => 1.5 ===
--- Zope3/src/zodb/utils.py:1.4	Thu Mar 13 16:32:27 2003
+++ Zope3/src/zodb/utils.py	Fri Jan 23 16:58:20 2004
@@ -15,6 +15,8 @@
 import struct
 import time
 
+from sets import Set
+
 def p64(v):
     """Pack an integer or long into a 8-byte string"""
     return struct.pack(">Q", v)
@@ -36,28 +38,4 @@
             break
         write(d)
         l = l - len(d)
-
-try:
-    from sets import Set
-except ImportError:
-    # This must be Python 2.2, which doesn't have a standard sets module.
-    # ZODB needs only a very limited subset of the Set API.
-    class Set(dict):
-        def __init__(self, arg=None):
-            if arg:
-                if isinstance(arg, dict):
-                    self.update(arg)
-                else:
-                    # XXX the proper sets version is much more robust
-                    for o in arg:
-                        self[o] = 1
-        def add(self, o):
-            self[o] = 1
-        def remove(self, o):
-            del self[o]
-        def __ior__(self, other):
-            if not isinstance(other, Set):
-                return NotImplemented
-            self.update(other)
-            return self
 




More information about the Zope3-Checkins mailing list