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:
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:
......
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