m3dev / gokart

Gokart solves reproducibility, task dependencies, constraints of good code, and ease of use for Machine Learning Pipeline.
https://gokart.readthedocs.io/en/latest/
MIT License
318 stars 57 forks source link

mypy: Allow ChoiceParameter to set Literal Type #397

Open kitagry opened 1 month ago

kitagry commented 1 month ago

Expected

T = Literal["foo", "bar"]
t: T = luigi.ChoiceParameter(choices=typing.get_args(T), var_type=str)  # ok

Actual

T = Literal["foo", "bar"]
t: T = luigi.ChoiceParameter(choices=typing.get_args(T), var_type=str)  # mypy: error