Skip to content

Commit b0c0c91

Browse files
authored
Merge branch 'master' into fix/client-run
2 parents 63efa07 + 1d67b64 commit b0c0c91

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
@@ -47,6 +47,8 @@ These changes are available on the `master` branch, but have not yet been releas
4747
([#2924](https://github.com/Pycord-Development/pycord/pull/2924))
4848
- Fixed OPUS Decode Error when recording audio.
4949
([#2925](https://github.com/Pycord-Development/pycord/pull/2925))
50+
- Fixed a `TypeError` when typing `ui.Select` without providing optional type arguments.
51+
([#2943](https://github.com/Pycord-Development/pycord/pull/2943))
5052

5153
### Removed
5254

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,25 +63,17 @@
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 .view import View
7170

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

8275

83-
class Select(Generic[V, ST], Item[V]):
76+
class Select(Item[V], Generic[V, ST]):
8477
"""Represents a UI select menu.
8578
8679
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)