typing: Tighten type annotation for settings.CACHES.

In zliencer.management.commands.populate_db, we assign the value of
settings.CACHES["default"] to `default_cache`.

django-stubs infers `settings.CACHES` to be `Dict[str, object]`. We make
the type specific enough so that we can access `default_cache` as a
dict.

Signed-off-by: Zixuan James Li <p359101898@gmail.com>
This commit is contained in:
Zixuan James Li 2022-06-20 15:20:29 -04:00 committed by Tim Abbott
parent 1860b0b7ac
commit c968b299db
1 changed files with 1 additions and 1 deletions

View File

@ -337,7 +337,7 @@ SESSION_ENGINE = "zerver.lib.safe_session_cached_db"
MEMCACHED_PASSWORD = get_secret("memcached_password") MEMCACHED_PASSWORD = get_secret("memcached_password")
CACHES = { CACHES: Dict[str, Dict[str, object]] = {
"default": { "default": {
"BACKEND": "zerver.lib.singleton_bmemcached.SingletonBMemcached", "BACKEND": "zerver.lib.singleton_bmemcached.SingletonBMemcached",
"LOCATION": MEMCACHED_LOCATION, "LOCATION": MEMCACHED_LOCATION,