From 94d1c067181c26d80d5d6098ee28e2a2ab8cdb14 Mon Sep 17 00:00:00 2001 From: Lumouille <144063653+Lumabots@users.noreply.github.com> Date: Fri, 14 Nov 2025 17:53:31 +0200 Subject: [PATCH 1/6] Update select.py --- discord/ui/select.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/discord/ui/select.py b/discord/ui/select.py index ef94aa9647..d2a3dd2900 100644 --- a/discord/ui/select.py +++ b/discord/ui/select.py @@ -72,7 +72,7 @@ ST = TypeVar("ST", bound="Snowflake | str", covariant=True, default=Any) S = TypeVar("S", bound="Select") V = TypeVar("V", bound="BaseView", covariant=True) -M = TypeVar("M", bound="DesignerModal", covariant=True) +M = TypeVar("M", bound="DesignerModal", covariant=True, default=Any) class Select(ViewItem[V], ModalItem[M], Generic[V, M, ST]): From 9d5f94374e8e6f2e386b236b97b8d541d9a0aafa Mon Sep 17 00:00:00 2001 From: Lumouille <144063653+Lumabots@users.noreply.github.com> Date: Fri, 14 Nov 2025 18:02:03 +0200 Subject: [PATCH 2/6] fix: update TypeVar defaults for BaseView and DesignerModal in select.py --- discord/ui/select.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/discord/ui/select.py b/discord/ui/select.py index d2a3dd2900..47ece18fe9 100644 --- a/discord/ui/select.py +++ b/discord/ui/select.py @@ -71,8 +71,8 @@ ST = TypeVar("ST", bound="Snowflake | str", covariant=True, default=Any) S = TypeVar("S", bound="Select") -V = TypeVar("V", bound="BaseView", covariant=True) -M = TypeVar("M", bound="DesignerModal", covariant=True, default=Any) +V = TypeVar("V", bound="BaseView", covariant=True, default=BaseView) +M = TypeVar("M", bound="DesignerModal", covariant=True, default=DesignerModal) class Select(ViewItem[V], ModalItem[M], Generic[V, M, ST]): From 0aecab9d32aab420795cd51c73a645b96934c7eb Mon Sep 17 00:00:00 2001 From: Lumouille <144063653+Lumabots@users.noreply.github.com> Date: Fri, 14 Nov 2025 17:41:50 +0100 Subject: [PATCH 3/6] Update discord/ui/select.py Co-authored-by: Paillat Signed-off-by: Lumouille <144063653+Lumabots@users.noreply.github.com> --- discord/ui/select.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/discord/ui/select.py b/discord/ui/select.py index 47ece18fe9..368d40b3d9 100644 --- a/discord/ui/select.py +++ b/discord/ui/select.py @@ -72,7 +72,7 @@ ST = TypeVar("ST", bound="Snowflake | str", covariant=True, default=Any) S = TypeVar("S", bound="Select") V = TypeVar("V", bound="BaseView", covariant=True, default=BaseView) -M = TypeVar("M", bound="DesignerModal", covariant=True, default=DesignerModal) +M = TypeVar("M", bound="DesignerModal", covariant=True, default="DesignerModal") class Select(ViewItem[V], ModalItem[M], Generic[V, M, ST]): From a871ef28f96df5c0270a5eb801f2448245d215c7 Mon Sep 17 00:00:00 2001 From: Lumouille <144063653+Lumabots@users.noreply.github.com> Date: Fri, 14 Nov 2025 18:44:02 +0200 Subject: [PATCH 4/6] fix: update TypeVar default for V in select.py --- discord/ui/select.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/discord/ui/select.py b/discord/ui/select.py index 368d40b3d9..3969739fa4 100644 --- a/discord/ui/select.py +++ b/discord/ui/select.py @@ -71,7 +71,7 @@ ST = TypeVar("ST", bound="Snowflake | str", covariant=True, default=Any) S = TypeVar("S", bound="Select") -V = TypeVar("V", bound="BaseView", covariant=True, default=BaseView) +V = TypeVar("V", bound="BaseView", covariant=True, default="BaseView") M = TypeVar("M", bound="DesignerModal", covariant=True, default="DesignerModal") From e3b980fcb8e49bbe322384445564e2e85dde1111 Mon Sep 17 00:00:00 2001 From: Lumouille <144063653+Lumabots@users.noreply.github.com> Date: Sat, 15 Nov 2025 11:48:31 +0200 Subject: [PATCH 5/6] fix: update changelog to reflect fix for breaking change in ui.Select Generic typing --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 35321c2858..616a633269 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,6 +22,9 @@ These changes are available on the `master` branch, but have not yet been releas ### Fixed +- Fixed breaking change in `ui.Select` Generic typing by adding default values to TypeVars. + ([#3002](https://github.com/Pycord-Development/pycord/pull/3002)) + ### Deprecated ### Removed From ebd0ce5043e974940c7f7c05a4c418507ce4f5ea Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Sat, 15 Nov 2025 09:49:02 +0000 Subject: [PATCH 6/6] style(pre-commit): auto fixes from pre-commit.com hooks --- CHANGELOG.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 616a633269..c5696f04d6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,9 +22,9 @@ These changes are available on the `master` branch, but have not yet been releas ### Fixed -- Fixed breaking change in `ui.Select` Generic typing by adding default values to TypeVars. - ([#3002](https://github.com/Pycord-Development/pycord/pull/3002)) - +- Fixed breaking change in `ui.Select` Generic typing by adding default values to + TypeVars. ([#3002](https://github.com/Pycord-Development/pycord/pull/3002)) + ### Deprecated ### Removed