Skip to content

Commit 0bb8756

Browse files
authored
Merge branch 'master' into cv2_fixes
Signed-off-by: UK <[email protected]>
2 parents bba29af + 1d67b64 commit 0bb8756

File tree

3 files changed

+8
-13
lines changed

3 files changed

+8
-13
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@ These changes are available on the `master` branch, but have not yet been releas
4545
([#2924](https://github.com/Pycord-Development/pycord/pull/2924))
4646
- Fixed OPUS Decode Error when recording audio.
4747
([#2925](https://github.com/Pycord-Development/pycord/pull/2925))
48+
- Fixed a `TypeError` when typing `ui.Select` without providing optional type arguments.
49+
([#2943](https://github.com/Pycord-Development/pycord/pull/2943))
4850

4951
### Removed
5052

discord/ui/select.py

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,11 @@
2727

2828
import inspect
2929
import os
30-
import sys
3130
from collections.abc import Sequence
3231
from functools import partial
33-
from typing import TYPE_CHECKING, Any, Callable, Generic, Literal, TypeVar, overload
32+
from typing import TYPE_CHECKING, Any, Callable, Generic, Literal, overload
33+
34+
from typing_extensions import Self, TypeVar
3435

3536
from ..channel import _threaded_guild_channel_factory
3637
from ..components import SelectDefaultValue, SelectMenu, SelectOption
@@ -62,27 +63,19 @@
6263
)
6364

6465
if TYPE_CHECKING:
65-
from typing_extensions import Self
66-
6766
from ..abc import GuildChannel, Snowflake
6867
from ..types.components import SelectMenu as SelectMenuPayload
6968
from ..types.interactions import ComponentInteractionData
7069
from .modal import DesignerModal
7170
from .view import BaseView
7271

73-
ST = TypeVar("ST", bound=Snowflake | str, covariant=True, default=Any)
74-
else:
75-
if sys.version_info >= (3, 13):
76-
ST = TypeVar("ST", bound="Snowflake | str", covariant=True, default=Any)
77-
else:
78-
ST = TypeVar("ST", bound="Snowflake | str", covariant=True)
79-
72+
ST = TypeVar("ST", bound="Snowflake | str", covariant=True, default=Any)
8073
S = TypeVar("S", bound="Select")
8174
V = TypeVar("V", bound="BaseView", covariant=True)
8275
M = TypeVar("M", bound="DesignerModal", covariant=True)
8376

8477

85-
class Select(Generic[V, M, ST], ViewItem[V], ModalItem[M]):
78+
class Select(ViewItem[V], ModalItem[M], Generic[V, M, ST]):
8679
"""Represents a UI select menu.
8780
8881
This is usually represented as a drop down menu.

requirements/_.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
aiohttp>=3.6.0,<4.0
2-
typing_extensions>=4.5.0,<5
2+
typing_extensions>=4.12.0,<5

0 commit comments

Comments
 (0)