diff options
author | Patrick Cloke <clokep@users.noreply.github.com> | 2021-05-24 15:32:01 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-05-24 15:32:01 -0400 |
commit | 7adcb20fc02d614b4a2b03b128b279f25633e2bd (patch) | |
tree | 00bfca91a453c3611274f28a27d58b979ad9f104 /synapse/util/msisdn.py | |
parent | Fix docker image to not log at `/homeserver.log` (#10045) (diff) | |
download | synapse-7adcb20fc02d614b4a2b03b128b279f25633e2bd.tar.xz |
Add missing type hints to synapse.util (#9982)
Diffstat (limited to 'synapse/util/msisdn.py')
-rw-r--r-- | synapse/util/msisdn.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/synapse/util/msisdn.py b/synapse/util/msisdn.py index bbbdebf264..1046224f15 100644 --- a/synapse/util/msisdn.py +++ b/synapse/util/msisdn.py @@ -17,19 +17,19 @@ import phonenumbers from synapse.api.errors import SynapseError -def phone_number_to_msisdn(country, number): +def phone_number_to_msisdn(country: str, number: str) -> str: """ Takes an ISO-3166-1 2 letter country code and phone number and returns an msisdn representing the canonical version of that phone number. Args: - country (str): ISO-3166-1 2 letter country code - number (str): Phone number in a national or international format + country: ISO-3166-1 2 letter country code + number: Phone number in a national or international format Returns: - (str) The canonical form of the phone number, as an msisdn + The canonical form of the phone number, as an msisdn Raises: - SynapseError if the number could not be parsed. + SynapseError if the number could not be parsed. """ try: phoneNumber = phonenumbers.parse(number, country) |