Use inline type hints in various other places (in synapse/) (#10380)

This commit is contained in:
Jonathan de Jong 2021-07-15 12:02:43 +02:00 committed by GitHub
parent c7603af1d0
commit bf72d10dbf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
79 changed files with 329 additions and 336 deletions

View file

@ -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":