Commit e94f7e66 authored by Jeremy Hylton's avatar Jeremy Hylton

Rewrite new_persistent_id() to make it clear what's going on.

Reformat all the code to use Python style.

We got an undiagnosed bug report for coptimization, which lead to an
attempt at code review.

Break up a the large new_persistent_id() function into several helpers
-- get_class(), get_class_tuple(), and set_oid().  Each function now
does a little less.  Don't reuse variable names for random purposes.
parent 121f2e20
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
############################################################################## ##############################################################################
"""Database connection support """Database connection support
$Id: Connection.py,v 1.75 2002/09/07 17:22:09 jeremy Exp $""" $Id: Connection.py,v 1.76 2002/09/16 23:50:39 jeremy Exp $"""
from cPickleCache import PickleCache, MUCH_RING_CHECKING from cPickleCache import PickleCache, MUCH_RING_CHECKING
from POSException import ConflictError, ReadConflictError from POSException import ConflictError, ReadConflictError
...@@ -350,7 +350,7 @@ class Connection(ExportImport.ExportImport): ...@@ -350,7 +350,7 @@ class Connection(ExportImport.ExportImport):
file=StringIO() file=StringIO()
seek=file.seek seek=file.seek
pickler=Pickler(file,1) pickler=Pickler(file,1)
pickler.persistent_id=new_persistent_id(self, stack.append) pickler.persistent_id=new_persistent_id(self, stack)
dbstore=self._storage.store dbstore=self._storage.store
file=file.getvalue file=file.getvalue
cache=self._cache cache=self._cache
......
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment