From c812e7120cc33ba24919e2518409a79fe08ae6d4 Mon Sep 17 00:00:00 2001 From: Trygve Aaberge Date: Wed, 1 Feb 2023 19:02:11 +0100 Subject: Remove unnecessary checks for dict keys With pyright v1.1.292 or later these checks are no longer necessary (they were never necessary for the runtime, only added for pyright). --- slack/slack_conversation.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'slack') diff --git a/slack/slack_conversation.py b/slack/slack_conversation.py index 2733302..913883c 100644 --- a/slack/slack_conversation.py +++ b/slack/slack_conversation.py @@ -67,7 +67,7 @@ class SlackConversation: return self._info["id"] async def name(self) -> str: - if "is_im" in self._info and self._info["is_im"] is True: + if self._info["is_im"] is True: im_user = await self.workspace.users[self._info["user"]] return im_user.nick() elif self._info["is_mpim"] is True: @@ -83,7 +83,7 @@ class SlackConversation: return self._info["name"] def name_prefix(self, name_type: Literal["full_name", "short_name"]) -> str: - if "is_im" in self._info and self._info["is_im"] is True: + if self._info["is_im"] is True: if name_type == "short_name": return " " else: -- cgit