-
-
Notifications
You must be signed in to change notification settings - Fork 853
Closed
Labels
featureNew feature, enhancement or requestNew feature, enhancement or request
Description
Support for the literal type (python 3.8 or via typing_extensions) would be nice. Eg.
def get_list(output: Literal["raw", "json", "yaml"] = "raw"):
if output == "json":
typer.echo(json.dumps([1, 2, 3]))The only workarounds (using string or multiple bool flags + validating input) are ugly now.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
featureNew feature, enhancement or requestNew feature, enhancement or request