diff options
author | Patrick Cloke <clokep@users.noreply.github.com> | 2021-06-08 11:19:25 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-06-08 11:19:25 -0400 |
commit | c7f3fb27451038c0f4b80a557f27eae849d55de2 (patch) | |
tree | 657fdf2218de5bef3796740a15ffdf99f61e3c8e /synapse/http | |
parent | Make changelog lines consistent (diff) | |
download | synapse-c7f3fb27451038c0f4b80a557f27eae849d55de2.tar.xz |
Add type hints to the federation server transport. (#10080)
Diffstat (limited to 'synapse/http')
-rw-r--r-- | synapse/http/servlet.py | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/synapse/http/servlet.py b/synapse/http/servlet.py index d61563d39b..72e2ec78db 100644 --- a/synapse/http/servlet.py +++ b/synapse/http/servlet.py @@ -295,6 +295,30 @@ def parse_strings_from_args( return default +@overload +def parse_string_from_args( + args: Dict[bytes, List[bytes]], + name: str, + default: Optional[str] = None, + required: Literal[True] = True, + allowed_values: Optional[Iterable[str]] = None, + encoding: str = "ascii", +) -> str: + ... + + +@overload +def parse_string_from_args( + args: Dict[bytes, List[bytes]], + name: str, + default: Optional[str] = None, + required: bool = False, + allowed_values: Optional[Iterable[str]] = None, + encoding: str = "ascii", +) -> Optional[str]: + ... + + def parse_string_from_args( args: Dict[bytes, List[bytes]], name: str, |