[Zope-Checkins] CVS: Zope3/lib/python/Transaction - _defaultTransaction.py:1.1.2.3

Jeremy Hylton jeremy@zope.com
Sat, 9 Mar 2002 18:20:30 -0500


Update of /cvs-repository/Zope3/lib/python/Transaction
In directory cvs.zope.org:/tmp/cvs-serv3090

Modified Files:
      Tag: Zope-3x-branch
	_defaultTransaction.py 
Log Message:
A little simplification at the expense of a little optimization.


=== Zope3/lib/python/Transaction/_defaultTransaction.py 1.1.2.2 => 1.1.2.3 ===
     
     def __init__(self, id=None):
-        self._id=id
-        self._objects=[]
-        self._append=self._objects.append
+        self._id = id
+        self._objects = []
 
     def _init(self):
-        self._objects=[]
-        self._append=self._objects.append
-        self.user=self.description=''
+        self._objects = []
+        self.user = self.description = ''
         if self._connections:
-            for c in self._connections.values(): c.close()
+            for c in self._connections.values():
+                c.close()
             del self._connections
 
     def sub(self):
@@ -316,9 +315,9 @@
             del objects[:] # clear registered
             if not subtransaction and self._id is not None: free_transaction()
 
-    def register(self,object):
+    def register(self, object):
         'Register the given object for transaction control.'
-        self._append(object)
+        self._objects.append(object)
 
     def note(self, text):
         if self.description: