summary refs log tree commit diff
path: root/synapse/types.py
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2021-07-16 11:25:22 +0100
committerErik Johnston <erik@matrix.org>2021-07-16 11:25:22 +0100
commitcc07548d7154811b46537db67e6735214551dd24 (patch)
tree79fa084a29bb512fe7a5eb826484140e34ef8a61 /synapse/types.py
parentMerge remote-tracking branch 'origin/release-v1.38' into matrix-org-hotfixes (diff)
parentUse inline type hints in `http/federation/`, `storage/` and `util/` (#10381) (diff)
downloadsynapse-cc07548d7154811b46537db67e6735214551dd24.tar.xz
Merge remote-tracking branch 'origin/develop' into matrix-org-hotfixes
Diffstat (limited to 'synapse/types.py')
-rw-r--r--synapse/types.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/synapse/types.py b/synapse/types.py

index 8d2fa00f71..fad23c8700 100644 --- a/synapse/types.py +++ b/synapse/types.py
@@ -182,14 +182,14 @@ def create_requester( ) -def get_domain_from_id(string): +def get_domain_from_id(string: str) -> str: idx = string.find(":") if idx == -1: raise SynapseError(400, "Invalid ID: %r" % (string,)) return string[idx + 1 :] -def get_localpart_from_id(string): +def get_localpart_from_id(string: str) -> str: idx = string.find(":") if idx == -1: raise SynapseError(400, "Invalid ID: %r" % (string,)) @@ -210,7 +210,7 @@ class DomainSpecificString(metaclass=abc.ABCMeta): 'domain' : The domain part of the name """ - SIGIL = abc.abstractproperty() # type: str # type: ignore + SIGIL: str = abc.abstractproperty() # type: ignore localpart = attr.ib(type=str) domain = attr.ib(type=str) @@ -304,7 +304,7 @@ class GroupID(DomainSpecificString): @classmethod def from_string(cls: Type[DS], s: str) -> DS: - group_id = super().from_string(s) # type: DS # type: ignore + group_id: DS = super().from_string(s) # type: ignore if not group_id.localpart: raise SynapseError(400, "Group ID cannot be empty", Codes.INVALID_PARAM) @@ -600,7 +600,7 @@ class StreamToken: groups_key = attr.ib(type=int) _SEPARATOR = "_" - START = None # type: StreamToken + START: "StreamToken" @classmethod async def from_string(cls, store: "DataStore", string: str) -> "StreamToken":