[Zodb-checkins] SVN: ZODB/branches/3.6/src/persistent/ merging
changes adding pop() method and tests for persistent mapping
from trunk
Thomas Lotze
tl at gocept.com
Sun Nov 20 19:21:20 EST 2005
Log message for revision 40283:
merging changes adding pop() method and tests for persistent mapping from trunk
Changed:
U ZODB/branches/3.6/src/persistent/dict.py
U ZODB/branches/3.6/src/persistent/mapping.py
A ZODB/branches/3.6/src/persistent/tests/test_mapping.py
-=-
Modified: ZODB/branches/3.6/src/persistent/dict.py
===================================================================
--- ZODB/branches/3.6/src/persistent/dict.py 2005-11-21 00:21:03 UTC (rev 40282)
+++ ZODB/branches/3.6/src/persistent/dict.py 2005-11-21 00:21:20 UTC (rev 40283)
@@ -39,6 +39,7 @@
__super_clear = IterableUserDict.clear
__super_update = IterableUserDict.update
__super_setdefault = IterableUserDict.setdefault
+ __super_pop = IterableUserDict.pop
__super_popitem = IterableUserDict.popitem
__super_p_init = persistent.Persistent.__init__
@@ -72,6 +73,10 @@
self._p_changed = True
return self.__super_setdefault(key, failobj)
+ def pop(self, i):
+ self._p_changed = True
+ return self.__super_pop(i)
+
def popitem(self):
self._p_changed = True
return self.__super_popitem()
Modified: ZODB/branches/3.6/src/persistent/mapping.py
===================================================================
--- ZODB/branches/3.6/src/persistent/mapping.py 2005-11-21 00:21:03 UTC (rev 40282)
+++ ZODB/branches/3.6/src/persistent/mapping.py 2005-11-21 00:21:20 UTC (rev 40283)
@@ -67,6 +67,15 @@
return self.__super_setdefault(key, failobj)
try:
+ __super_pop = UserDict.pop
+ except AttributeError:
+ pass
+ else:
+ def pop(self, i):
+ self._p_changed = 1
+ return self.__super_pop(i)
+
+ try:
__super_popitem = UserDict.popitem
except AttributeError:
pass
Copied: ZODB/branches/3.6/src/persistent/tests/test_mapping.py (from rev 40269, ZODB/trunk/src/persistent/tests/test_mapping.py)
Property changes on: ZODB/branches/3.6/src/persistent/tests/test_mapping.py
___________________________________________________________________
Name: cvs2svn:cvs-rev
+ 1.2
Name: svn:keywords
+ Id
Name: svn:eol-style
+ native
More information about the Zodb-checkins
mailing list