mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-04 14: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
|
@ -226,7 +226,7 @@ class _Node:
|
|||
# footprint down. Storing `None` is free as its a singleton, while empty
|
||||
# lists are 56 bytes (and empty sets are 216 bytes, if we did the naive
|
||||
# thing and used sets).
|
||||
self.callbacks = None # type: Optional[List[Callable[[], None]]]
|
||||
self.callbacks: Optional[List[Callable[[], None]]] = None
|
||||
|
||||
self.add_callbacks(callbacks)
|
||||
|
||||
|
@ -362,15 +362,15 @@ class LruCache(Generic[KT, VT]):
|
|||
|
||||
# register_cache might call our "set_cache_factor" callback; there's nothing to
|
||||
# do yet when we get resized.
|
||||
self._on_resize = None # type: Optional[Callable[[],None]]
|
||||
self._on_resize: Optional[Callable[[], None]] = None
|
||||
|
||||
if cache_name is not None:
|
||||
metrics = register_cache(
|
||||
metrics: Optional[CacheMetric] = register_cache(
|
||||
"lru_cache",
|
||||
cache_name,
|
||||
self,
|
||||
collect_callback=metrics_collection_callback,
|
||||
) # type: Optional[CacheMetric]
|
||||
)
|
||||
else:
|
||||
metrics = None
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue