diff --git a/synapse/push/push_rule_evaluator.py b/synapse/push/push_rule_evaluator.py
index 854ffd625e603bd970515afc4b10b4d68379c2a1..2ce9e444abdaab888c9fb472e9f3ebad893d8149 100644
--- a/synapse/push/push_rule_evaluator.py
+++ b/synapse/push/push_rule_evaluator.py
@@ -187,7 +187,7 @@ class PushRuleEvaluatorForEvent:
 # Caches (string, is_glob, word_boundary) -> regex for push. See _glob_matches
 regex_cache = LruCache(
     50000, "regex_push_cache"
-)  # type: LruCache[Tuple[str, bool, bool],Pattern]
+)  # type: LruCache[Tuple[str, bool, bool], Pattern]
 
 
 def _glob_matches(glob: str, value: str, word_boundary: bool = False) -> bool:
diff --git a/synapse/util/caches/lrucache.py b/synapse/util/caches/lrucache.py
index 0eed53d3f495f6f2eefe143ebf72cb863c3cb93e..1a2c2d4c0b09162a9930c4b09885374d06892e60 100644
--- a/synapse/util/caches/lrucache.py
+++ b/synapse/util/caches/lrucache.py
@@ -283,7 +283,7 @@ class LruCache(Generic[KT, VT]):
                 return value
 
         @overload
-        def cache_pop(key: KT, default: Literal[None] = None) -> Union[None, VT]:
+        def cache_pop(key: KT, default: Literal[None] = None) -> Optional[VT]:
             ...
 
         @overload