Skip to content

Commit 8f851aa

Browse files
LumabotsPaillat-devpre-commit-ci[bot]
authored
fix: Fix breaking change in ui.Select Generic typing (#3002)
* Update select.py * fix: update TypeVar defaults for BaseView and DesignerModal in select.py * Update discord/ui/select.py Co-authored-by: Paillat <[email protected]> Signed-off-by: Lumouille <[email protected]> * fix: update TypeVar default for V in select.py * fix: update changelog to reflect fix for breaking change in ui.Select Generic typing * style(pre-commit): auto fixes from pre-commit.com hooks --------- Signed-off-by: Lumouille <[email protected]> Co-authored-by: Paillat <[email protected]> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent 0e0f69b commit 8f851aa

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ These changes are available on the `master` branch, but have not yet been releas
2222

2323
### Fixed
2424

25+
- Fixed breaking change in `ui.Select` Generic typing by adding default values to
26+
TypeVars. ([#3002](https://github.com/Pycord-Development/pycord/pull/3002))
27+
2528
### Deprecated
2629

2730
### Removed

discord/ui/select.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,8 @@
7171

7272
ST = TypeVar("ST", bound="Snowflake | str", covariant=True, default=Any)
7373
S = TypeVar("S", bound="Select")
74-
V = TypeVar("V", bound="BaseView", covariant=True)
75-
M = TypeVar("M", bound="DesignerModal", covariant=True)
74+
V = TypeVar("V", bound="BaseView", covariant=True, default="BaseView")
75+
M = TypeVar("M", bound="DesignerModal", covariant=True, default="DesignerModal")
7676

7777

7878
class Select(ViewItem[V], ModalItem[M], Generic[V, M, ST]):

0 commit comments

Comments
 (0)