mirror of
https://github.com/element-hq/synapse.git
synced 2026-08-28 05:04:38 +00:00
Use type hinting generics in standard collections (#19046)
aka PEP 585, added in Python 3.9 - https://peps.python.org/pep-0585/ - https://docs.astral.sh/ruff/rules/non-pep585-annotation/
This commit is contained in:
@@ -20,7 +20,6 @@
|
||||
#
|
||||
|
||||
from http import HTTPStatus
|
||||
from typing import Tuple
|
||||
|
||||
from twisted.web.server import Request
|
||||
|
||||
@@ -52,7 +51,7 @@ class CancellableReplicationEndpoint(ReplicationEndpoint):
|
||||
@cancellable
|
||||
async def _handle_request( # type: ignore[override]
|
||||
self, request: Request, content: JsonDict
|
||||
) -> Tuple[int, JsonDict]:
|
||||
) -> tuple[int, JsonDict]:
|
||||
await self.clock.sleep(1.0)
|
||||
return HTTPStatus.OK, {"result": True}
|
||||
|
||||
@@ -73,7 +72,7 @@ class UncancellableReplicationEndpoint(ReplicationEndpoint):
|
||||
|
||||
async def _handle_request( # type: ignore[override]
|
||||
self, request: Request, content: JsonDict
|
||||
) -> Tuple[int, JsonDict]:
|
||||
) -> tuple[int, JsonDict]:
|
||||
await self.clock.sleep(1.0)
|
||||
return HTTPStatus.OK, {"result": True}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user