From b4ff5230a9947aed4c3c2c88cf22f618233190ce Mon Sep 17 00:00:00 2001 From: Steve Howell Date: Mon, 11 Dec 2017 10:35:03 -0600 Subject: [PATCH] mypy: Fix StateHandler annotations. `get` and `put` deal with arbitrary JSON-serializable types, so `Text` was an innacurate annotation. --- zulip_bots/zulip_bots/lib.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/zulip_bots/zulip_bots/lib.py b/zulip_bots/zulip_bots/lib.py index 8cc7591..0aab3f7 100644 --- a/zulip_bots/zulip_bots/lib.py +++ b/zulip_bots/zulip_bots/lib.py @@ -71,14 +71,14 @@ class StateHandler(object): raise StateHandlerError("Error initializing state: {}".format(str(response))) def put(self, key, value): - # type: (Text, Text) -> None + # type: (Text, Any) -> None self.state_[key] = self.marshal(value) response = self._client.update_storage({'storage': {key: self.state_[key]}}) if response['result'] != 'success': raise StateHandlerError("Error updating state: {}".format(str(response))) def get(self, key): - # type: (Text) -> Text + # type: (Text) -> Any return self.demarshal(self.state_[key]) def contains(self, key):