Use typing.Literal for channel and component type annotation

This commit is contained in:
Lilly Rose Berner
2022-04-29 12:07:22 +02:00
committed by GitHub
parent 7fca030107
commit 7ee15e1d68
6 changed files with 28 additions and 23 deletions

View File

@ -25,7 +25,7 @@ DEALINGS IN THE SOFTWARE.
from __future__ import annotations
import os
from typing import TYPE_CHECKING, Optional, Tuple, TypeVar
from typing import TYPE_CHECKING, Literal, Optional, Tuple, TypeVar
from ..components import TextInput as TextInputComponent
from ..enums import ComponentType, TextStyle
@ -231,7 +231,7 @@ class TextInput(Item[V]):
)
@property
def type(self) -> ComponentType:
def type(self) -> Literal[ComponentType.text_input]:
return ComponentType.text_input
def is_dispatchable(self) -> bool: