Create an empty copy of the given cache.
(
cache: t.Optional[t.MutableMapping],
)
| 91 | |
| 92 | |
| 93 | def copy_cache( |
| 94 | cache: t.Optional[t.MutableMapping], |
| 95 | ) -> t.Optional[t.MutableMapping[t.Tuple[weakref.ref, str], "Template"]]: |
| 96 | """Create an empty copy of the given cache.""" |
| 97 | if cache is None: |
| 98 | return None |
| 99 | |
| 100 | if type(cache) is dict: |
| 101 | return {} |
| 102 | |
| 103 | return LRUCache(cache.capacity) # type: ignore |
| 104 | |
| 105 | |
| 106 | def load_extensions( |