Skip to content
This repository was archived by the owner on Apr 26, 2024. It is now read-only.

More types for synapse.util, part 1 #10888

Merged
merged 23 commits into from
Oct 6, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Make stream_change_cache pass no-untyped-defs
  • Loading branch information
David Robertson committed Sep 22, 2021
commit 53dae76188f0b5e406dffd3d843ae3a296fcdf7f
3 changes: 3 additions & 0 deletions mypy.ini
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,9 @@ disallow_untyped_defs = True
[mypy-synapse.util.caches.dictionary_cache]
disallow_untyped_defs = True

[mypy-synapse.util.caches.stream_change_cache]
disallow_untyped_defs = True

[mypy-synapse.util.caches.ttl_cache]
disallow_untyped_defs = True

Expand Down
6 changes: 3 additions & 3 deletions synapse/util/caches/stream_change_cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@ def __init__(
self,
name: str,
current_stream_pos: int,
max_size=10000,
max_size: int = 10000,
prefilled_cache: Optional[Mapping[EntityType, int]] = None,
):
self._original_max_size = max_size
) -> None:
self._original_max_size: int = max_size
self._max_size = math.floor(max_size)
self._entity_to_key: Dict[EntityType, int] = {}

Expand Down