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:
Andrew Ferrazzutti
2025-10-22 17:48:19 -04:00
committed by GitHub
parent cba3a814c6
commit fc244bb592
539 changed files with 4599 additions and 5066 deletions
+5 -5
View File
@@ -17,7 +17,7 @@
# [This file includes modifications made by New Vector Limited]
#
#
from typing import Any, Dict, List, Tuple
from typing import Any
from unittest.mock import Mock
from parameterized import parameterized
@@ -51,7 +51,7 @@ class HTTPPusherTests(HomeserverTestCase):
hijack_auth = False
def make_homeserver(self, reactor: MemoryReactor, clock: Clock) -> HomeServer:
self.push_attempts: List[Tuple[Deferred, str, dict]] = []
self.push_attempts: list[tuple[Deferred, str, dict]] = []
m = Mock()
@@ -747,7 +747,7 @@ class HTTPPusherTests(HomeserverTestCase):
def _make_user_with_pusher(
self, username: str, enabled: bool = True
) -> Tuple[str, str]:
) -> tuple[str, str]:
"""Registers a user and creates a pusher for them.
Args:
@@ -925,7 +925,7 @@ class HTTPPusherTests(HomeserverTestCase):
ret = self.get_success(
self.hs.get_datastores().main.get_pushers_by({"user_name": user_id})
)
pushers: List[PusherConfig] = list(ret)
pushers: list[PusherConfig] = list(ret)
# Check that we still have one pusher, and that the device ID associated with
# it didn't change.
@@ -1118,7 +1118,7 @@ class HTTPPusherTests(HomeserverTestCase):
device_id = user_tuple.device_id
# Set the push data dict based on test input parameters
push_data: Dict[str, Any] = {
push_data: dict[str, Any] = {
"url": "http://example.com/_matrix/push/v1/notify",
}
if disable_badge_count: