mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-04 22:24:55 -04:00
Use inline type hints in http/federation/
, storage/
and util/
(#10381)
This commit is contained in:
parent
3acf85c85f
commit
bdfde6dca1
38 changed files with 149 additions and 161 deletions
|
@ -45,10 +45,10 @@ class StreamChangeCache:
|
|||
):
|
||||
self._original_max_size = max_size
|
||||
self._max_size = math.floor(max_size)
|
||||
self._entity_to_key = {} # type: Dict[EntityType, int]
|
||||
self._entity_to_key: Dict[EntityType, int] = {}
|
||||
|
||||
# map from stream id to the a set of entities which changed at that stream id.
|
||||
self._cache = SortedDict() # type: SortedDict[int, Set[EntityType]]
|
||||
self._cache: SortedDict[int, Set[EntityType]] = SortedDict()
|
||||
|
||||
# the earliest stream_pos for which we can reliably answer
|
||||
# get_all_entities_changed. In other words, one less than the earliest
|
||||
|
@ -155,7 +155,7 @@ class StreamChangeCache:
|
|||
if stream_pos < self._earliest_known_stream_pos:
|
||||
return None
|
||||
|
||||
changed_entities = [] # type: List[EntityType]
|
||||
changed_entities: List[EntityType] = []
|
||||
|
||||
for k in self._cache.islice(start=self._cache.bisect_right(stream_pos)):
|
||||
changed_entities.extend(self._cache[k])
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue