mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-02 09:56:05 -04:00
Add type hints to get_domain_from_id and get_localpart_from_id. (#10385)
This commit is contained in:
parent
2d16e69b4b
commit
30b56f6925
3 changed files with 75 additions and 26 deletions
|
@ -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,))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue