diff options
author | Patrick Cloke <clokep@users.noreply.github.com> | 2021-09-20 08:56:23 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-09-20 08:56:23 -0400 |
commit | b3590614da7e3e17e75530a9d4808df17be9b127 (patch) | |
tree | c57aaff95611f6ca47fc9355602fac304c4d8a5a /synapse/handlers/groups_local.py | |
parent | Fix remove_stale_pushers job on SQLite. (#10843) (diff) | |
download | synapse-b3590614da7e3e17e75530a9d4808df17be9b127.tar.xz |
Require type hints in the handlers module. (#10831)
Adds missing type hints to methods in the synapse.handlers module and requires all methods to have type hints there. This also removes the unused construct_auth_difference method from the FederationHandler.
Diffstat (limited to 'synapse/handlers/groups_local.py')
-rw-r--r-- | synapse/handlers/groups_local.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/synapse/handlers/groups_local.py b/synapse/handlers/groups_local.py index 1a6c5c64a2..9e270d461b 100644 --- a/synapse/handlers/groups_local.py +++ b/synapse/handlers/groups_local.py @@ -14,7 +14,7 @@ # limitations under the License. import logging -from typing import TYPE_CHECKING, Dict, Iterable, List, Set +from typing import TYPE_CHECKING, Any, Awaitable, Callable, Dict, Iterable, List, Set from synapse.api.errors import HttpResponseException, RequestSendFailed, SynapseError from synapse.types import GroupID, JsonDict, get_domain_from_id @@ -25,12 +25,14 @@ if TYPE_CHECKING: logger = logging.getLogger(__name__) -def _create_rerouter(func_name): +def _create_rerouter(func_name: str) -> Callable[..., Awaitable[JsonDict]]: """Returns an async function that looks at the group id and calls the function on federation or the local group server if the group is local """ - async def f(self, group_id, *args, **kwargs): + async def f( + self: "GroupsLocalWorkerHandler", group_id: str, *args: Any, **kwargs: Any + ) -> JsonDict: if not GroupID.is_valid(group_id): raise SynapseError(400, "%s is not a legal group ID" % (group_id,)) |