mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-03 02:54:52 -04:00
Use inline type hints in various other places (in synapse/
) (#10380)
This commit is contained in:
parent
c7603af1d0
commit
bf72d10dbf
79 changed files with 329 additions and 336 deletions
|
@ -85,9 +85,9 @@ class Stream:
|
|||
time it was called.
|
||||
"""
|
||||
|
||||
NAME = None # type: str # The name of the stream
|
||||
NAME: str # The name of the stream
|
||||
# The type of the row. Used by the default impl of parse_row.
|
||||
ROW_TYPE = None # type: Any
|
||||
ROW_TYPE: Any = None
|
||||
|
||||
@classmethod
|
||||
def parse_row(cls, row: StreamRow):
|
||||
|
@ -283,9 +283,7 @@ class PresenceStream(Stream):
|
|||
|
||||
assert isinstance(presence_handler, PresenceHandler)
|
||||
|
||||
update_function = (
|
||||
presence_handler.get_all_presence_updates
|
||||
) # type: UpdateFunction
|
||||
update_function: UpdateFunction = presence_handler.get_all_presence_updates
|
||||
else:
|
||||
# Query presence writer process
|
||||
update_function = make_http_update_function(hs, self.NAME)
|
||||
|
@ -334,9 +332,9 @@ class TypingStream(Stream):
|
|||
if writer_instance == hs.get_instance_name():
|
||||
# On the writer, query the typing handler
|
||||
typing_writer_handler = hs.get_typing_writer_handler()
|
||||
update_function = (
|
||||
typing_writer_handler.get_all_typing_updates
|
||||
) # type: Callable[[str, int, int, int], Awaitable[Tuple[List[Tuple[int, Any]], int, bool]]]
|
||||
update_function: Callable[
|
||||
[str, int, int, int], Awaitable[Tuple[List[Tuple[int, Any]], int, bool]]
|
||||
] = typing_writer_handler.get_all_typing_updates
|
||||
current_token_function = typing_writer_handler.get_current_token
|
||||
else:
|
||||
# Query the typing writer process
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue