summary refs log tree commit diff
path: root/synapse/util
diff options
context:
space:
mode:
authordependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>2024-03-13 17:05:57 +0000
committerGitHub <noreply@github.com>2024-03-13 17:05:57 +0000
commite161103b46e9e85b95575ad12b34eb7ec570e0a4 (patch)
tree968de33935c76f2d2e0c560819684e7859a067f6 /synapse/util
parentBump dawidd6/action-download-artifact from 3.1.1 to 3.1.2 (#16960) (diff)
downloadsynapse-e161103b46e9e85b95575ad12b34eb7ec570e0a4.tar.xz
Bump mypy from 1.5.1 to 1.8.0 (#16901)
Diffstat (limited to 'synapse/util')
-rw-r--r--synapse/util/async_helpers.py12
-rw-r--r--synapse/util/caches/dictionary_cache.py2
-rw-r--r--synapse/util/caches/expiringcache.py2
3 files changed, 4 insertions, 12 deletions
diff --git a/synapse/util/async_helpers.py b/synapse/util/async_helpers.py
index d50b5dd346..70139beef2 100644
--- a/synapse/util/async_helpers.py
+++ b/synapse/util/async_helpers.py
@@ -284,15 +284,7 @@ async def yieldable_gather_results(
     try:
         return await make_deferred_yieldable(
             defer.gatherResults(
-                # type-ignore: mypy reports two errors:
-                # error: Argument 1 to "run_in_background" has incompatible type
-                #     "Callable[[T, **P], Awaitable[R]]"; expected
-                #     "Callable[[T, **P], Awaitable[R]]"  [arg-type]
-                # error: Argument 2 to "run_in_background" has incompatible type
-                #     "T"; expected "[T, **P.args]"  [arg-type]
-                # The former looks like a mypy bug, and the latter looks like a
-                # false positive.
-                [run_in_background(func, item, *args, **kwargs) for item in iter],  # type: ignore[arg-type]
+                [run_in_background(func, item, *args, **kwargs) for item in iter],
                 consumeErrors=True,
             )
         )
@@ -338,7 +330,7 @@ async def yieldable_gather_results_delaying_cancellation(
         return await make_deferred_yieldable(
             delay_cancellation(
                 defer.gatherResults(
-                    [run_in_background(func, item, *args, **kwargs) for item in iter],  # type: ignore[arg-type]
+                    [run_in_background(func, item, *args, **kwargs) for item in iter],
                     consumeErrors=True,
                 )
             )
diff --git a/synapse/util/caches/dictionary_cache.py b/synapse/util/caches/dictionary_cache.py
index 4245b7289c..1e6696332f 100644
--- a/synapse/util/caches/dictionary_cache.py
+++ b/synapse/util/caches/dictionary_cache.py
@@ -229,7 +229,7 @@ class DictionaryCache(Generic[KT, DKT, DV]):
         for dict_key in missing:
             # We explicitly add each dict key to the cache, so that cache hit
             # rates and LRU times for each key can be tracked separately.
-            value = entry.get(dict_key, _Sentinel.sentinel)  # type: ignore[arg-type]
+            value = entry.get(dict_key, _Sentinel.sentinel)
             self.cache[(key, dict_key)] = _PerKeyValue(value)
 
             if value is not _Sentinel.sentinel:
diff --git a/synapse/util/caches/expiringcache.py b/synapse/util/caches/expiringcache.py
index 462016f820..8017c031ee 100644
--- a/synapse/util/caches/expiringcache.py
+++ b/synapse/util/caches/expiringcache.py
@@ -142,7 +142,7 @@ class ExpiringCache(Generic[KT, VT]):
             return default
 
         if self.iterable:
-            self.metrics.inc_evictions(EvictionReason.invalidation, len(value.value))  # type: ignore[arg-type]
+            self.metrics.inc_evictions(EvictionReason.invalidation, len(value.value))
         else:
             self.metrics.inc_evictions(EvictionReason.invalidation)