[Zope-Checkins] CVS: Zope2 - referencesf.py:1.2
Jim Fulton
jim@digicool.com
Wed, 21 Mar 2001 10:05:22 -0500 (EST)
Update of /cvs-repository/Zope2/lib/python/ZODB
In directory korak:/tmp/cvs-serv8130
Modified Files:
referencesf.py
Log Message:
Returning the references list makes the API much cleaner,
which will help new storage writers.
Creating the reference list when one isn't passed is a bonus.
--- Updated File referencesf.py in package Zope2 --
--- referencesf.py 1999/05/18 15:55:10 1.1
+++ referencesf.py 2001/03/21 15:05:21 1.2
@@ -86,12 +86,13 @@
"""
import cPickle, cStringIO
-def referencesf(p,rootl,
+def referencesf(p, rootl=None,
Unpickler=cPickle.Unpickler,
StringIO=cStringIO.StringIO,
tt=type(()),
- type=type):
+ type=type, None=None):
+ if rootl is None: rootl=[]
u=Unpickler(StringIO(p))
l=len(rootl)
u.persistent_load=rootl
@@ -113,4 +114,5 @@
if v:
if type(v) is tt: v=v[0]
rootl[i]=v
-
+
+ return rootl