Insert key with a value of default if key is not in the dictionary. Return the value for key if key is in the dictionary, else default.
(self, key, default=None)
| 267 | return default |
| 268 | |
| 269 | def setdefault(self, key, default=None): |
| 270 | '''Insert key with a value of default if key is not in the dictionary. |
| 271 | |
| 272 | Return the value for key if key is in the dictionary, else default. |
| 273 | ''' |
| 274 | if key in self: |
| 275 | return self[key] |
| 276 | self[key] = default |
| 277 | return default |
| 278 | |
| 279 | @_recursive_repr() |
| 280 | def __repr__(self): |
no outgoing calls