[Zodb-checkins] SVN: ZODB/branches/alienoid-btrees_setdefault/src/BTrees/Interfaces.py Added setdefault to IDictionaryIsh interface.

Ruslan Spivak rspivak at nuxeo.com
Sat Aug 27 20:29:26 EDT 2005


Log message for revision 38124:
  Added setdefault to IDictionaryIsh interface.

Changed:
  U   ZODB/branches/alienoid-btrees_setdefault/src/BTrees/Interfaces.py

-=-
Modified: ZODB/branches/alienoid-btrees_setdefault/src/BTrees/Interfaces.py
===================================================================
--- ZODB/branches/alienoid-btrees_setdefault/src/BTrees/Interfaces.py	2005-08-28 00:23:41 UTC (rev 38123)
+++ ZODB/branches/alienoid-btrees_setdefault/src/BTrees/Interfaces.py	2005-08-28 00:29:25 UTC (rev 38124)
@@ -214,6 +214,14 @@
         integer values, the normalization is division.
         """
 
+    def setdefault(key, d):
+        """D.setdefault(k[, d]) -> D.get(k, d), also set D[k]=d if k not in D
+
+        Return the value like get() except that if key is missing, d is both
+        returned and inserted into the dictionary as the value of k.
+        d defaults to None.
+        """
+
 class IBTree(IDictionaryIsh):
 
     def insert(key, value):



More information about the Zodb-checkins mailing list