From 36071821c3a40c58a64b1883b5b7a7673a44fd71 Mon Sep 17 00:00:00 2001 From: Kartik Srivastava Date: Fri, 5 Jun 2020 21:04:48 +0530 Subject: [PATCH] api: Update type annotation in 'remove_subscriptions'. This updates the type annotation for the 'principals' argument to accept a list of email addresses as well as user ids. --- zulip/zulip/__init__.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/zulip/zulip/__init__.py b/zulip/zulip/__init__.py index f61935b..4c95d8b 100644 --- a/zulip/zulip/__init__.py +++ b/zulip/zulip/__init__.py @@ -15,7 +15,7 @@ import distro from configparser import SafeConfigParser import urllib.parse import logging -from typing import Any, Callable, Dict, Iterable, IO, List, Mapping, Optional, Text, Tuple, Union +from typing import Any, Callable, Dict, Iterable, IO, List, Mapping, Optional, Text, Tuple, Union, Sequence __version__ = "0.7.0" @@ -1302,13 +1302,11 @@ class Client: request=request, ) - def remove_subscriptions(self, streams: Iterable[str], principals: Optional[Iterable[str]] = None) -> Dict[str, Any]: + def remove_subscriptions(self, streams: Iterable[str], + principals: Union[Sequence[str], Sequence[int]] = []) -> Dict[str, Any]: ''' See examples/unsubscribe for example usage. ''' - if principals is None: - principals = [] - request = dict( subscriptions=streams, principals=principals