summaryrefslogtreecommitdiffstats
path: root/Lib/weakref.py
diff options
context:
space:
mode:
authorWalter Dörwald <walter@livinglogic.de>2004-05-27 18:16:25 (GMT)
committerWalter Dörwald <walter@livinglogic.de>2004-05-27 18:16:25 (GMT)
commit80ce6dd5642025f5cdf0ba5556f08df0803f5636 (patch)
treeee80f3c46ef4a0700feda4443510780f2e5655da /Lib/weakref.py
parentc139909611162e995321c09a32c4e42433e2655e (diff)
downloadcpython-80ce6dd5642025f5cdf0ba5556f08df0803f5636.zip
cpython-80ce6dd5642025f5cdf0ba5556f08df0803f5636.tar.gz
cpython-80ce6dd5642025f5cdf0ba5556f08df0803f5636.tar.bz2
The default argument in dict.setdefault() defaults to None.
Add this default to weakref.WeakValueDictionary.setdefault() and weakref.WeakKeyDictionary.setdefault() too.
Diffstat (limited to 'Lib/weakref.py')
-rw-r--r--Lib/weakref.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/weakref.py b/Lib/weakref.py
index 5c66186..510cd7c 100644
--- a/Lib/weakref.py
+++ b/Lib/weakref.py
@@ -113,7 +113,7 @@ class WeakValueDictionary(UserDict.UserDict):
else:
return o
- def setdefault(self, key, default):
+ def setdefault(self, key, default=None):
try:
wr = self.data[key]
except KeyError:
@@ -241,7 +241,7 @@ class WeakKeyDictionary(UserDict.UserDict):
def pop(self, key, *args):
return self.data.pop(ref(key), *args)
- def setdefault(self, key, default):
+ def setdefault(self, key, default=None):
return self.data.setdefault(ref(key, self._remove),default)
def update(self, dict=None, **kwargs):