Browse Source

Fix type error with ItemCallbackType

master
Rapptz 8 hours ago
parent
commit
6f6d990195
  1. 3
      discord/ui/action_row.py
  2. 3
      discord/ui/button.py

3
discord/ui/action_row.py

@ -65,10 +65,11 @@ if TYPE_CHECKING:
from ..emoji import Emoji from ..emoji import Emoji
from ..components import SelectOption from ..components import SelectOption
from ..interactions import Interaction from ..interactions import Interaction
from .container import Container
SelectCallbackDecorator = Callable[[ItemCallbackType['S', BaseSelectT]], BaseSelectT] SelectCallbackDecorator = Callable[[ItemCallbackType['S', BaseSelectT]], BaseSelectT]
S = TypeVar('S', bound=Union['ActionRow', 'LayoutView'], covariant=True) S = TypeVar('S', bound=Union['ActionRow', 'Container', 'LayoutView'], covariant=True)
V = TypeVar('V', bound='LayoutView', covariant=True) V = TypeVar('V', bound='LayoutView', covariant=True)
__all__ = ('ActionRow',) __all__ = ('ActionRow',)

3
discord/ui/button.py

@ -45,10 +45,11 @@ if TYPE_CHECKING:
from .view import BaseView from .view import BaseView
from .action_row import ActionRow from .action_row import ActionRow
from .container import Container
from ..emoji import Emoji from ..emoji import Emoji
from ..types.components import ButtonComponent as ButtonComponentPayload from ..types.components import ButtonComponent as ButtonComponentPayload
S = TypeVar('S', bound='Union[BaseView, ActionRow]', covariant=True) S = TypeVar('S', bound='Union[BaseView, Container, ActionRow]', covariant=True)
V = TypeVar('V', bound='BaseView', covariant=True) V = TypeVar('V', bound='BaseView', covariant=True)

Loading…
Cancel
Save