Skip to content

mypy: Allow ChoiceParameter to set Literal Type #397

@kitagry

Description

@kitagry

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions