Kaydet (Commit) c1399096 authored tarafından Walter Dörwald's avatar Walter Dörwald

The default argument in dict.setdefault() defaults to None.

Add this default to UserDict.DictMixin.setdefault() too.
üst 08678a10
...@@ -113,7 +113,7 @@ class DictMixin: ...@@ -113,7 +113,7 @@ class DictMixin:
def clear(self): def clear(self):
for key in self.keys(): for key in self.keys():
del self[key] del self[key]
def setdefault(self, key, default): def setdefault(self, key, default=None):
try: try:
return self[key] return self[key]
except KeyError: except KeyError:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment