Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mypy: Allow ChoiceParameter to set Literal Type #397

Open
kitagry opened this issue Sep 19, 2024 · 0 comments
Open

mypy: Allow ChoiceParameter to set Literal Type #397

kitagry opened this issue Sep 19, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@kitagry
Copy link
Member

kitagry commented Sep 19, 2024

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
@kitagry kitagry added the enhancement New feature or request label Sep 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant