Adds misc missing type hints (#11953)

This commit is contained in:
Patrick Cloke 2022-02-11 07:20:16 -05:00 committed by GitHub
parent c3db7a0b59
commit a121507cfe
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 48 additions and 41 deletions

View file

@ -233,8 +233,8 @@ class HomeServer(metaclass=abc.ABCMeta):
self,
hostname: str,
config: HomeServerConfig,
reactor=None,
version_string="Synapse",
reactor: Optional[ISynapseReactor] = None,
version_string: str = "Synapse",
):
"""
Args:
@ -244,7 +244,7 @@ class HomeServer(metaclass=abc.ABCMeta):
if not reactor:
from twisted.internet import reactor as _reactor
reactor = _reactor
reactor = cast(ISynapseReactor, _reactor)
self._reactor = reactor
self.hostname = hostname
@ -264,7 +264,7 @@ class HomeServer(metaclass=abc.ABCMeta):
self._module_web_resources: Dict[str, Resource] = {}
self._module_web_resources_consumed = False
def register_module_web_resource(self, path: str, resource: Resource):
def register_module_web_resource(self, path: str, resource: Resource) -> None:
"""Allows a module to register a web resource to be served at the given path.
If multiple modules register a resource for the same path, the module that