From 9cf0e3bad103635f5925a9f3f58571ba7012ffe8 Mon Sep 17 00:00:00 2001 From: Chromosomologist Date: Mon, 23 Sep 2024 11:10:26 +0200 Subject: [PATCH] fix: use typing_extensions for py3.8 compat --- poetry.lock | 6 +++--- pyproject.toml | 2 +- src/disnake/ext/components/interaction.py | 7 ++++--- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/poetry.lock b/poetry.lock index 972d380..fe78624 100644 --- a/poetry.lock +++ b/poetry.lock @@ -957,13 +957,13 @@ windows-terminal = ["colorama (>=0.4.6)"] [[package]] name = "pyright" -version = "1.1.377" +version = "1.1.381" description = "Command line wrapper for pyright" optional = false python-versions = ">=3.7" files = [ - {file = "pyright-1.1.377-py3-none-any.whl", hash = "sha256:af0dd2b6b636c383a6569a083f8c5a8748ae4dcde5df7914b3f3f267e14dd162"}, - {file = "pyright-1.1.377.tar.gz", hash = "sha256:aabc30fedce0ded34baa0c49b24f10e68f4bfc8f68ae7f3d175c4b0f256b4fcf"}, + {file = "pyright-1.1.381-py3-none-any.whl", hash = "sha256:5dc0aa80a265675d36abab59c674ae01dbe476714f91845b61b841d34aa99081"}, + {file = "pyright-1.1.381.tar.gz", hash = "sha256:314cf0c1351c189524fb10c7ac20688ecd470e8cc505c394d642c9c80bf7c3a5"}, ] [package.dependencies] diff --git a/pyproject.toml b/pyproject.toml index 67ffb84..09f0794 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -51,7 +51,7 @@ build-backend = "poetry.core.masonry.api" [tool.pyright] typeCheckingMode = "strict" -python-version = 3.8 +pythonVersion = "3.8" reportMissingTypeStubs = false exclude = [ # Default options diff --git a/src/disnake/ext/components/interaction.py b/src/disnake/ext/components/interaction.py index b508165..d02e9e5 100644 --- a/src/disnake/ext/components/interaction.py +++ b/src/disnake/ext/components/interaction.py @@ -6,6 +6,7 @@ import typing import disnake +import typing_extensions from disnake.ext.components.api import component as component_api __all__: typing.Sequence[str] = ( @@ -46,16 +47,16 @@ disnake.ui.MentionableSelect[typing.Any], ] -P = typing.ParamSpec("P") +P = typing_extensions.ParamSpec("P") InteractionT = typing.TypeVar("InteractionT", bound=disnake.Interaction) ReturnT = typing.TypeVar("ReturnT") InteractionCallback = typing.Callable[ - typing.Concatenate[InteractionT, P], + typing_extensions.Concatenate[InteractionT, P], typing.Coroutine[None, None, ReturnT], ] InteractionCallbackMethod = typing.Callable[ - typing.Concatenate[typing.Any, InteractionT, P], + typing_extensions.Concatenate[typing.Any, InteractionT, P], typing.Coroutine[None, None, ReturnT], ]