mirror of
https://github.com/element-hq/synapse.git
synced 2026-10-23 10:53:31 +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:
1 parent
cba3a814c6
commit
fc244bb592
539 files changed
+4599
-5066
No files matched your search
@@ -18,7 +18,7 @@
|
||||
# [This file includes modifications made by New Vector Limited]
|
||||
#
|
||||
#
|
||||
from typing import List, Optional
|
||||
from typing import Optional
|
||||
|
||||
from parameterized import parameterized
|
||||
|
||||
@@ -272,7 +272,7 @@ class FederationTestCase(unittest.HomeserverTestCase):
|
||||
"""Testing order list with parameter `order_by`"""
|
||||
|
||||
def _order_test(
|
||||
expected_destination_list: List[str],
|
||||
expected_destination_list: list[str],
|
||||
order_by: Optional[str],
|
||||
dir: Optional[str] = None,
|
||||
) -> None:
|
||||
@@ -521,7 +521,7 @@ class FederationTestCase(unittest.HomeserverTestCase):
|
||||
dest = f"sub{i}.example.com"
|
||||
self._create_destination(dest, 50, 50, 50, 100)
|
||||
|
||||
def _check_fields(self, content: List[JsonDict]) -> None:
|
||||
def _check_fields(self, content: list[JsonDict]) -> None:
|
||||
"""Checks that the expected destination attributes are present in content
|
||||
|
||||
Args:
|
||||
@@ -820,7 +820,7 @@ class DestinationMembershipTestCase(unittest.HomeserverTestCase):
|
||||
self,
|
||||
number_rooms: int,
|
||||
destination: Optional[str] = None,
|
||||
) -> List[str]:
|
||||
) -> list[str]:
|
||||
"""
|
||||
Create the given number of rooms. The given `destination` homeserver will
|
||||
be recorded as a participant.
|
||||
@@ -853,7 +853,7 @@ class DestinationMembershipTestCase(unittest.HomeserverTestCase):
|
||||
|
||||
return room_ids
|
||||
|
||||
def _check_fields(self, content: List[JsonDict]) -> None:
|
||||
def _check_fields(self, content: list[JsonDict]) -> None:
|
||||
"""Checks that the expected room attributes are present in content
|
||||
|
||||
Args:
|
||||
|
||||
Reference in new issue
Block a user