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

@ -23,7 +23,7 @@ DEALINGS IN THE SOFTWARE.
"""
from __future__ import annotations
from typing import List, Optional, TYPE_CHECKING, Tuple, TypeVar, Callable, Union
from typing import List, Literal, Optional, TYPE_CHECKING, Tuple, TypeVar, Callable, Union
import inspect
import os
@ -288,7 +288,7 @@ class Select(Item[V]):
)
@property
def type(self) -> ComponentType:
def type(self) -> Literal[ComponentType.select]:
return self._underlying.type
def is_dispatchable(self) -> bool: