summary refs log tree commit diff
diff options
context:
space:
mode:
authorOlivier Wilkinson (reivilibre) <olivier@librepush.net>2021-08-24 14:01:48 +0100
committerOlivier Wilkinson (reivilibre) <olivier@librepush.net>2021-08-24 14:01:48 +0100
commit07303c1c998bf56416dcd1a1541cc0751d213a7e (patch)
treedbdb4091fe562fd21a0f82f02d4d9b40afecb159
parentTweak this; we can do better (diff)
downloadsynapse-07303c1c998bf56416dcd1a1541cc0751d213a7e.tar.xz
Fix type annotations on olddeps
-rw-r--r--synapse/util/caches/multi_key_response_cache.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/synapse/util/caches/multi_key_response_cache.py b/synapse/util/caches/multi_key_response_cache.py
index 1e35c33a4b..c87bb3734e 100644
--- a/synapse/util/caches/multi_key_response_cache.py
+++ b/synapse/util/caches/multi_key_response_cache.py
@@ -85,7 +85,7 @@ class MultiKeyResponseCache(Generic[KV]):
     def __len__(self) -> int:
         return self.size()
 
-    def get(self, key: KV) -> Optional[defer.Deferred]:
+    def get(self, key: KV) -> "Optional[defer.Deferred[RV]]":
         """Look up the given key.
 
         Returns a new Deferred (which also doesn't follow the synapse
@@ -110,7 +110,7 @@ class MultiKeyResponseCache(Generic[KV]):
 
     def _set(
         self, context: MultiKeyResponseCacheContext[KV], deferred: defer.Deferred
-    ) -> defer.Deferred:
+    ) -> "defer.Deferred[RV]":
         """Set the entry for the given key to the given deferred.
 
         *deferred* should run its callbacks in the sentinel logcontext (ie,
@@ -164,7 +164,7 @@ class MultiKeyResponseCache(Generic[KV]):
         *args: Any,
         cache_context: bool = False,
         **kwargs: Any,
-    ) -> defer.Deferred[RV]:
+    ) -> "defer.Deferred[RV]":
         """Perform a *set* call, taking care of logcontexts
 
         Makes a call to *callback(*args, **kwargs)*, which should