From 4aba6c983384ab51029a91ea1a9ee8be8847ac57 Mon Sep 17 00:00:00 2001 From: Tim Abbott Date: Sat, 24 Jul 2021 11:08:12 -0700 Subject: [PATCH] mypy: Use Sequence in push notifications types. This is important for variance reasons. --- zerver/lib/push_notifications.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/zerver/lib/push_notifications.py b/zerver/lib/push_notifications.py index 19ed8071d8..bbfd039b09 100644 --- a/zerver/lib/push_notifications.py +++ b/zerver/lib/push_notifications.py @@ -130,7 +130,7 @@ APNS_MAX_RETRIES = 3 @statsd_increment("apple_push_notification") def send_apple_push_notification( - user_id: int, devices: List[DeviceToken], payload_data: Dict[str, Any], remote: bool = False + user_id: int, devices: Sequence[DeviceToken], payload_data: Dict[str, Any], remote: bool = False ) -> None: if not devices: return @@ -294,7 +294,10 @@ def parse_gcm_options(options: Dict[str, Any], data: Dict[str, Any]) -> str: @statsd_increment("android_push_notification") def send_android_push_notification( - devices: List[DeviceToken], data: Dict[str, Any], options: Dict[str, Any], remote: bool = False + devices: Sequence[DeviceToken], + data: Dict[str, Any], + options: Dict[str, Any], + remote: bool = False, ) -> None: """ Send a GCM message to the given devices.