From 83b41a2e9e0c3ac95e2ccb1e4f2819a7926d4616 Mon Sep 17 00:00:00 2001 From: "neiljp (Neil Pilgrim)" Date: Sat, 31 Mar 2018 11:32:45 -0700 Subject: [PATCH] zulip: Amend default value of remove_subscriptions:principals to None. Having a default parameter as '[]' may not be an issue with the current implementation, but general practice is to default to None and assign a default list subsequently. --- zulip/zulip/__init__.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/zulip/zulip/__init__.py b/zulip/zulip/__init__.py index 86a6915..c070057 100644 --- a/zulip/zulip/__init__.py +++ b/zulip/zulip/__init__.py @@ -816,11 +816,14 @@ class Client(object): request=request, ) - def remove_subscriptions(self, streams, principals=[]): + def remove_subscriptions(self, streams, principals=None): # type: (Iterable[str], Optional[Iterable[str]]) -> Dict[str, Any] ''' See examples/unsubscribe for example usage. ''' + if principals is None: + principals = [] + request = dict( subscriptions=streams, principals=principals