mirror of
https://github.com/python/cpython.git
synced 2025-07-24 11:44:31 +00:00
The default argument in dict.setdefault() defaults to None.
Add this default to UserDict.DictMixin.setdefault() too.
This commit is contained in:
parent
08678a1055
commit
c139909611
1 changed files with 1 additions and 1 deletions
|
@ -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:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue