diff options
author | Trygve Aaberge <trygveaa@gmail.com> | 2023-02-01 19:02:11 +0100 |
---|---|---|
committer | Trygve Aaberge <trygveaa@gmail.com> | 2024-02-18 11:32:53 +0100 |
commit | c812e7120cc33ba24919e2518409a79fe08ae6d4 (patch) | |
tree | c1575da127faee4565464aff69bdaba53e725fa0 | |
parent | 47be4d1f6ee818ca7f075e4c611793ab940e4dcc (diff) | |
download | wee-slack-c812e7120cc33ba24919e2518409a79fe08ae6d4.tar.gz |
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).
-rw-r--r-- | poetry.lock | 16 | ||||
-rw-r--r-- | pyproject.toml | 2 | ||||
-rw-r--r-- | slack/slack_conversation.py | 4 |
3 files changed, 11 insertions, 11 deletions
diff --git a/poetry.lock b/poetry.lock index a358dda..6573b91 100644 --- a/poetry.lock +++ b/poetry.lock @@ -193,18 +193,18 @@ files = [ [[package]] name = "isort" -version = "5.11.4" +version = "5.11.5" description = "A Python utility / library to sort Python imports." optional = false python-versions = ">=3.7.0" files = [ - {file = "isort-5.11.4-py3-none-any.whl", hash = "sha256:c033fd0edb91000a7f09527fe5c75321878f98322a77ddcc81adbd83724afb7b"}, - {file = "isort-5.11.4.tar.gz", hash = "sha256:6db30c5ded9815d813932c04c2f85a360bcdd35fed496f4d8f35495ef0a261b6"}, + {file = "isort-5.11.5-py3-none-any.whl", hash = "sha256:ba1d72fb2595a01c7895a5128f9585a5cc4b6d395f1c8d514989b9a7eb2a8746"}, + {file = "isort-5.11.5.tar.gz", hash = "sha256:6be1f76a507cb2ecf16c7cf14a37e41609ca082330be4e3436a18ef74add55db"}, ] [package.extras] colors = ["colorama (>=0.4.3,<0.5.0)"] -pipfile-deprecated-finder = ["pipreqs", "requirementslib"] +pipfile-deprecated-finder = ["pip-shims (>=0.5.2)", "pipreqs", "requirementslib"] plugins = ["setuptools"] requirements-deprecated-finder = ["pip-api", "pipreqs"] @@ -293,13 +293,13 @@ testing = ["pytest", "pytest-benchmark"] [[package]] name = "pyright" -version = "1.1.291" +version = "1.1.292" description = "Command line wrapper for pyright" optional = false python-versions = ">=3.7" files = [ - {file = "pyright-1.1.291-py3-none-any.whl", hash = "sha256:2dbd133ee400e81ff319d0701bc47545a7ab1cd7dcfcf46c7de37d9b0fbbb76f"}, - {file = "pyright-1.1.291.tar.gz", hash = "sha256:3946f43f1a99f8e438eee1738ad0649d8bd7ac36dded25849245993ab02671bd"}, + {file = "pyright-1.1.292-py3-none-any.whl", hash = "sha256:23d1f14b15afe38bb7a7117b9861ad0546aff078da312d294e60a727445c23ff"}, + {file = "pyright-1.1.292.tar.gz", hash = "sha256:035ea1af6fabfdcc80c0afb545f677bd377114157d69779cce2a642ff894e51c"}, ] [package.dependencies] @@ -457,4 +457,4 @@ testing = ["flake8 (<5)", "func-timeout", "jaraco.functools", "jaraco.itertools" [metadata] lock-version = "2.0" python-versions = "^3.7" -content-hash = "c487e9c315062bdb2d27128b374c752f3935c1bfdfafc36c3c83db4e98b10464" +content-hash = "2a4a604c27d9462caca2a80ec4cb98da113f5e08de0ac3dffcc8e15e840293de" diff --git a/pyproject.toml b/pyproject.toml index c3afa01..0a6c406 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -25,7 +25,7 @@ pytest = "^7.1.3" pytest-cov = "^4.0.0" isort = "^5.10.1" typing-extensions = "^4.4.0" -pyright = "^1.1.291" +pyright = "^1.1.292" [tool.pylint.main] ignored-modules = ["weechat"] 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: |