Set `default` if the key is not in the cache otherwise leave unchanged. Return the value of this key.
(self, key: t.Any, default: t.Any = None)
| 468 | return default |
| 469 | |
| 470 | def setdefault(self, key: t.Any, default: t.Any = None) -> t.Any: |
| 471 | """Set `default` if the key is not in the cache otherwise |
| 472 | leave unchanged. Return the value of this key. |
| 473 | """ |
| 474 | try: |
| 475 | return self[key] |
| 476 | except KeyError: |
| 477 | self[key] = default |
| 478 | return default |
| 479 | |
| 480 | def clear(self) -> None: |
| 481 | """Clear the cache.""" |
no outgoing calls