d = defaultdict(str)
d['one'] = 'hi'
del d['one']
del d['one']
The second del raises a KeyError.
d.pop('one') has the same problem.
Is there a concise way to make the defaultdict reset-to-default a keypair?
if 'one' in d:
del d['one']
is more verbose than I would like.
defaultdict's__delitem__method to ignore theKeyError