Type Hint for Literal
New in Python 3.8. See PEP 586.
Recipes
from typing import Literal
x: Literal[1, 2, True, False] # one of 1, 2, True, False
New in Python 3.8. See PEP 586.
from typing import Literal
x: Literal[1, 2, True, False] # one of 1, 2, True, False