diff options
author | Walter Dörwald <walter@livinglogic.de> | 2004-05-27 09:41:04 (GMT) |
---|---|---|
committer | Walter Dörwald <walter@livinglogic.de> | 2004-05-27 09:41:04 (GMT) |
commit | c139909611162e995321c09a32c4e42433e2655e (patch) | |
tree | 303eddee3d060674095d1fe91d5d8117e1690ccb /Lib/UserDict.py | |
parent | 08678a1055b273ad7394f70ebfa17744ca1a6708 (diff) | |
download | cpython-c139909611162e995321c09a32c4e42433e2655e.zip cpython-c139909611162e995321c09a32c4e42433e2655e.tar.gz cpython-c139909611162e995321c09a32c4e42433e2655e.tar.bz2 |
The default argument in dict.setdefault() defaults to None.
Add this default to UserDict.DictMixin.setdefault() too.
Diffstat (limited to 'Lib/UserDict.py')
-rw-r--r-- | Lib/UserDict.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Lib/UserDict.py b/Lib/UserDict.py index 87cc6a3..703f118 100644 --- a/Lib/UserDict.py +++ b/Lib/UserDict.py @@ -113,7 +113,7 @@ class DictMixin: def clear(self): for key in self.keys(): del self[key] - def setdefault(self, key, default): + def setdefault(self, key, default=None): try: return self[key] except KeyError: |