I have a Literal
type of particular string values.
I'm trying to generate a list of those strings as well dynamically:
from typing import List, Literal, get_args
Color = Literal['red', 'green', 'blue']
colors = List[Color] = get_args(Color)
The third line at List
is throwing this error:
Generic class type cannot be assigned Pylance(reportGeneralTypeIssues)
I'm attempting to replicate this answer https://stackoverflow.com/a/64522240/12574341