summary refs log tree commit diff
path: root/synapse/http/servlet.py
diff options
context:
space:
mode:
Diffstat (limited to 'synapse/http/servlet.py')
-rw-r--r--synapse/http/servlet.py91
1 files changed, 30 insertions, 61 deletions
diff --git a/synapse/http/servlet.py b/synapse/http/servlet.py
index b22eb727b1..b73d06f1d3 100644
--- a/synapse/http/servlet.py
+++ b/synapse/http/servlet.py
@@ -61,20 +61,17 @@ logger = logging.getLogger(__name__)
 
 
 @overload
-def parse_integer(request: Request, name: str, default: int) -> int:
-    ...
+def parse_integer(request: Request, name: str, default: int) -> int: ...
 
 
 @overload
-def parse_integer(request: Request, name: str, *, required: Literal[True]) -> int:
-    ...
+def parse_integer(request: Request, name: str, *, required: Literal[True]) -> int: ...
 
 
 @overload
 def parse_integer(
     request: Request, name: str, default: Optional[int] = None, required: bool = False
-) -> Optional[int]:
-    ...
+) -> Optional[int]: ...
 
 
 def parse_integer(
@@ -105,8 +102,7 @@ def parse_integer_from_args(
     args: Mapping[bytes, Sequence[bytes]],
     name: str,
     default: Optional[int] = None,
-) -> Optional[int]:
-    ...
+) -> Optional[int]: ...
 
 
 @overload
@@ -115,8 +111,7 @@ def parse_integer_from_args(
     name: str,
     *,
     required: Literal[True],
-) -> int:
-    ...
+) -> int: ...
 
 
 @overload
@@ -125,8 +120,7 @@ def parse_integer_from_args(
     name: str,
     default: Optional[int] = None,
     required: bool = False,
-) -> Optional[int]:
-    ...
+) -> Optional[int]: ...
 
 
 def parse_integer_from_args(
@@ -172,20 +166,17 @@ def parse_integer_from_args(
 
 
 @overload
-def parse_boolean(request: Request, name: str, default: bool) -> bool:
-    ...
+def parse_boolean(request: Request, name: str, default: bool) -> bool: ...
 
 
 @overload
-def parse_boolean(request: Request, name: str, *, required: Literal[True]) -> bool:
-    ...
+def parse_boolean(request: Request, name: str, *, required: Literal[True]) -> bool: ...
 
 
 @overload
 def parse_boolean(
     request: Request, name: str, default: Optional[bool] = None, required: bool = False
-) -> Optional[bool]:
-    ...
+) -> Optional[bool]: ...
 
 
 def parse_boolean(
@@ -216,8 +207,7 @@ def parse_boolean_from_args(
     args: Mapping[bytes, Sequence[bytes]],
     name: str,
     default: bool,
-) -> bool:
-    ...
+) -> bool: ...
 
 
 @overload
@@ -226,8 +216,7 @@ def parse_boolean_from_args(
     name: str,
     *,
     required: Literal[True],
-) -> bool:
-    ...
+) -> bool: ...
 
 
 @overload
@@ -236,8 +225,7 @@ def parse_boolean_from_args(
     name: str,
     default: Optional[bool] = None,
     required: bool = False,
-) -> Optional[bool]:
-    ...
+) -> Optional[bool]: ...
 
 
 def parse_boolean_from_args(
@@ -289,8 +277,7 @@ def parse_bytes_from_args(
     args: Mapping[bytes, Sequence[bytes]],
     name: str,
     default: Optional[bytes] = None,
-) -> Optional[bytes]:
-    ...
+) -> Optional[bytes]: ...
 
 
 @overload
@@ -300,8 +287,7 @@ def parse_bytes_from_args(
     default: Literal[None] = None,
     *,
     required: Literal[True],
-) -> bytes:
-    ...
+) -> bytes: ...
 
 
 @overload
@@ -310,8 +296,7 @@ def parse_bytes_from_args(
     name: str,
     default: Optional[bytes] = None,
     required: bool = False,
-) -> Optional[bytes]:
-    ...
+) -> Optional[bytes]: ...
 
 
 def parse_bytes_from_args(
@@ -355,8 +340,7 @@ def parse_string(
     *,
     allowed_values: Optional[StrCollection] = None,
     encoding: str = "ascii",
-) -> str:
-    ...
+) -> str: ...
 
 
 @overload
@@ -367,8 +351,7 @@ def parse_string(
     required: Literal[True],
     allowed_values: Optional[StrCollection] = None,
     encoding: str = "ascii",
-) -> str:
-    ...
+) -> str: ...
 
 
 @overload
@@ -380,8 +363,7 @@ def parse_string(
     required: bool = False,
     allowed_values: Optional[StrCollection] = None,
     encoding: str = "ascii",
-) -> Optional[str]:
-    ...
+) -> Optional[str]: ...
 
 
 def parse_string(
@@ -437,8 +419,7 @@ def parse_enum(
     name: str,
     E: Type[EnumT],
     default: EnumT,
-) -> EnumT:
-    ...
+) -> EnumT: ...
 
 
 @overload
@@ -448,8 +429,7 @@ def parse_enum(
     E: Type[EnumT],
     *,
     required: Literal[True],
-) -> EnumT:
-    ...
+) -> EnumT: ...
 
 
 def parse_enum(
@@ -526,8 +506,7 @@ def parse_strings_from_args(
     *,
     allowed_values: Optional[StrCollection] = None,
     encoding: str = "ascii",
-) -> Optional[List[str]]:
-    ...
+) -> Optional[List[str]]: ...
 
 
 @overload
@@ -538,8 +517,7 @@ def parse_strings_from_args(
     *,
     allowed_values: Optional[StrCollection] = None,
     encoding: str = "ascii",
-) -> List[str]:
-    ...
+) -> List[str]: ...
 
 
 @overload
@@ -550,8 +528,7 @@ def parse_strings_from_args(
     required: Literal[True],
     allowed_values: Optional[StrCollection] = None,
     encoding: str = "ascii",
-) -> List[str]:
-    ...
+) -> List[str]: ...
 
 
 @overload
@@ -563,8 +540,7 @@ def parse_strings_from_args(
     required: bool = False,
     allowed_values: Optional[StrCollection] = None,
     encoding: str = "ascii",
-) -> Optional[List[str]]:
-    ...
+) -> Optional[List[str]]: ...
 
 
 def parse_strings_from_args(
@@ -625,8 +601,7 @@ def parse_string_from_args(
     *,
     allowed_values: Optional[StrCollection] = None,
     encoding: str = "ascii",
-) -> Optional[str]:
-    ...
+) -> Optional[str]: ...
 
 
 @overload
@@ -638,8 +613,7 @@ def parse_string_from_args(
     required: Literal[True],
     allowed_values: Optional[StrCollection] = None,
     encoding: str = "ascii",
-) -> str:
-    ...
+) -> str: ...
 
 
 @overload
@@ -650,8 +624,7 @@ def parse_string_from_args(
     required: bool = False,
     allowed_values: Optional[StrCollection] = None,
     encoding: str = "ascii",
-) -> Optional[str]:
-    ...
+) -> Optional[str]: ...
 
 
 def parse_string_from_args(
@@ -704,22 +677,19 @@ def parse_string_from_args(
 
 
 @overload
-def parse_json_value_from_request(request: Request) -> JsonDict:
-    ...
+def parse_json_value_from_request(request: Request) -> JsonDict: ...
 
 
 @overload
 def parse_json_value_from_request(
     request: Request, allow_empty_body: Literal[False]
-) -> JsonDict:
-    ...
+) -> JsonDict: ...
 
 
 @overload
 def parse_json_value_from_request(
     request: Request, allow_empty_body: bool = False
-) -> Optional[JsonDict]:
-    ...
+) -> Optional[JsonDict]: ...
 
 
 def parse_json_value_from_request(
@@ -847,7 +817,6 @@ def assert_params_in_dict(body: JsonDict, required: StrCollection) -> None:
 
 
 class RestServlet:
-
     """A Synapse REST Servlet.
 
     An implementing class can either provide its own custom 'register' method,