[Zope3-checkins] CVS: Zope3/src/zope/app/rdb - __init__.py:1.3

Steve Alexander steve@cat-box.net
Tue, 31 Dec 2002 06:50:14 -0500


Update of /cvs-repository/Zope3/src/zope/app/rdb
In directory cvs.zope.org:/tmp/cvs-serv15896

Modified Files:
	__init__.py 
Log Message:
removed reliance on __basicnew__


=== Zope3/src/zope/app/rdb/__init__.py 1.2 => 1.3 ===
--- Zope3/src/zope/app/rdb/__init__.py:1.2	Wed Dec 25 09:13:12 2002
+++ Zope3/src/zope/app/rdb/__init__.py	Tue Dec 31 06:50:14 2002
@@ -51,27 +51,14 @@
         row_class = RowClassFactory(columns)
         super(ResultSet, self).__init__(map(row_class, rows))
 
-    def __setstate__(self, data):
-        self.columns, rows = data
-        row_class = RowClassFactory(self.columns)
-        self.extend(map(row_class, rows))
-
     __safe_for_unpickling__ = True
 
     def __reduce__(self):
         cols = self.columns
-        return (ResultSet, None,
-                (self.columns,
-                 [[getattr(row, col) for col in cols]
-                  for row in self]
-                ))
-
-    # XXX __basicnew__ is deprecated in Python 2.3.
-    #     What to do instead?
-    def __basicnew__():
-        return ResultSet((), ())
-    __basicnew__ = staticmethod(__basicnew__)
-
+        return (ResultSet,
+                (cols, [[getattr(row, col) for col in cols] for row in self])
+               )
+                
     def __cmp__(self, other):
         if not isinstance(other, ResultSet):
             return super(ResultSet, self).__cmp__(other)