[Zope-Checkins] CVS: ZODB3/ZODB - Connection.py:1.98.6.4
Jeremy Hylton
jeremy@zope.com
Tue, 1 Jul 2003 17:03:44 -0400
Update of /cvs-repository/ZODB3/ZODB
In directory cvs.zope.org:/tmp/cvs-serv12940/ZODB
Modified Files:
Tag: zodb33-devel-branch
Connection.py
Log Message:
Get rid of default argument hack.
=== ZODB3/ZODB/Connection.py 1.98.6.3 => 1.98.6.4 ===
--- ZODB3/ZODB/Connection.py:1.98.6.3 Tue Jul 1 16:57:18 2003
+++ ZODB3/ZODB/Connection.py Tue Jul 1 17:03:43 2003
@@ -137,14 +137,14 @@
self.cacheGC = None
self._root_ = None
- def __getitem__(self, oid, tt=type(())):
+ def __getitem__(self, oid):
obj = self._cache.get(oid, None)
if obj is not None:
return obj
- __traceback_info__ = (oid)
+ __traceback_info__ = oid,
p, serial = self._storage.load(oid, self._version)
- __traceback_info__ = (oid, p)
+ __traceback_info__ = oid, p
file=StringIO(p)
unpickler=Unpickler(file)
unpickler.persistent_load=self._persistent_load
@@ -153,22 +153,21 @@
klass, args = object
- if type(klass) is tt:
+ if isinstance(klass, tuple):
module, name = klass
klass=self._db._classFactory(self, module, name)
- if (args is None or
- not args and not hasattr(klass,'__getinitargs__')):
- object=klass.__new__(klass)
+ if (args is None or not args and not hasattr(klass,'__getinitargs__')):
+ object = klass.__new__(klass)
else:
object = klass(*args)
if klass is not type:
object.__dict__.clear()
- object._p_oid=oid
- object._p_jar=self
- object._p_changed=None
- object._p_serial=serial
+ object._p_oid = oid
+ object._p_jar = self
+ object._p_changed = None
+ object._p_serial = serial
self._cache[oid] = object
if oid=='\0\0\0\0\0\0\0\0':