|
27 | 27 |
|
28 | 28 | import inspect |
29 | 29 | import os |
30 | | -import sys |
31 | 30 | from collections.abc import Sequence |
32 | 31 | 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 |
34 | 35 |
|
35 | 36 | from ..channel import _threaded_guild_channel_factory |
36 | 37 | from ..components import SelectDefaultValue, SelectMenu, SelectOption |
|
62 | 63 | ) |
63 | 64 |
|
64 | 65 | if TYPE_CHECKING: |
65 | | - from typing_extensions import Self |
66 | | - |
67 | 66 | from ..abc import GuildChannel, Snowflake |
68 | 67 | from ..types.components import SelectMenu as SelectMenuPayload |
69 | 68 | from ..types.interactions import ComponentInteractionData |
70 | 69 | from .modal import DesignerModal |
71 | 70 | from .view import BaseView |
72 | 71 |
|
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) |
80 | 73 | S = TypeVar("S", bound="Select") |
81 | 74 | V = TypeVar("V", bound="BaseView", covariant=True) |
82 | 75 | M = TypeVar("M", bound="DesignerModal", covariant=True) |
83 | 76 |
|
84 | 77 |
|
85 | | -class Select(Generic[V, M, ST], ViewItem[V], ModalItem[M]): |
| 78 | +class Select(ViewItem[V], ModalItem[M], Generic[V, M, ST]): |
86 | 79 | """Represents a UI select menu. |
87 | 80 |
|
88 | 81 | This is usually represented as a drop down menu. |
|
0 commit comments