mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-02 13:36:02 -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
|
@ -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":
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue