summary refs log tree commit diff
path: root/synapse/http
diff options
context:
space:
mode:
authorPatrick Cloke <clokep@users.noreply.github.com>2021-06-08 11:19:25 -0400
committerGitHub <noreply@github.com>2021-06-08 11:19:25 -0400
commitc7f3fb27451038c0f4b80a557f27eae849d55de2 (patch)
tree657fdf2218de5bef3796740a15ffdf99f61e3c8e /synapse/http
parentMake changelog lines consistent (diff)
downloadsynapse-c7f3fb27451038c0f4b80a557f27eae849d55de2.tar.xz
Add type hints to the federation server transport. (#10080)
Diffstat (limited to '')
-rw-r--r--synapse/http/servlet.py24
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,