[Zope3-checkins] CVS: ZODB4/Persistence - PersistentList.py:1.3 PersistentMapping.py:1.3
Jeremy Hylton
jeremy@zope.com
Mon, 29 Jul 2002 20:09:28 -0400
Update of /cvs-repository/ZODB4/Persistence
In directory cvs.zope.org:/tmp/cvs-serv4141/Persistence
Modified Files:
PersistentList.py PersistentMapping.py
Log Message:
Use a boolean for setting _p_changed.
=== ZODB4/Persistence/PersistentList.py 1.2 => 1.3 ===
def __setitem__(self, i, item):
self.__super_setitem(i, item)
- self._p_changed = 1
+ self._p_changed = True
def __delitem__(self, i):
self.__super_delitem(i)
- self._p_changed = 1
+ self._p_changed = True
def __setslice__(self, i, j, other):
self.__super_setslice(i, j, other)
- self._p_changed = 1
+ self._p_changed = True
def __delslice__(self, i, j):
self.__super_delslice(i, j)
- self._p_changed = 1
+ self._p_changed = True
def __iadd__(self, other):
self.__super_iadd(other)
- self._p_changed = 1
+ self._p_changed = True
def __imul__(self, n):
self.__super_imul(n)
- self._p_changed = 1
+ self._p_changed = True
def append(self, item):
self.__super_append(item)
- self._p_changed = 1
+ self._p_changed = True
def insert(self, i, item):
self.__super_insert(i, item)
- self._p_changed = 1
+ self._p_changed = True
def pop(self, i=-1):
rtn = self.__super_pop(i)
- self._p_changed = 1
+ self._p_changed = True
return rtn
def remove(self, item):
self.__super_remove(item)
- self._p_changed = 1
+ self._p_changed = True
def reverse(self):
self.__super_reverse()
- self._p_changed = 1
+ self._p_changed = True
def sort(self, *args):
self.__super_sort(*args)
- self._p_changed = 1
+ self._p_changed = True
def extend(self, other):
self.__super_extend(other)
- self._p_changed = 1
+ self._p_changed = True
# This works around a bug in Python 2.1.x (up to 2.1.2 at least) where the
# __cmp__ bogusly raises a RuntimeError, and because this is an extension
=== ZODB4/Persistence/PersistentMapping.py 1.2 => 1.3 ===
def __delitem__(self, key):
self.__super_delitem(key)
- self._p_changed = 1
+ self._p_changed = True
def __setitem__(self, key, v):
self.__super_setitem(key, v)
- self._p_changed = 1
+ self._p_changed = True
def clear(self):
self.__super_clear()
- self._p_changed = 1
+ self._p_changed = True
def update(self, b):
self.__super_update(b)
- self._p_changed = 1
+ self._p_changed = True
def setdefault(self, key, failobj=None):
# We could inline all of UserDict's implementation into the
# method here, but I'd rather not depend at all on the
# implementation in UserDict (simple as it is).
if not self.has_key(key):
- self._p_changed = 1
+ self._p_changed = True
return self.__super_setdefault(key, failobj)
def popitem(self):
- self._p_changed = 1
+ self._p_changed = True
return self.__super_popitem()