-
-
Notifications
You must be signed in to change notification settings - Fork 825
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.
weakish, gautierdag, 5j9, carlthome, blackary and 45 more
Metadata
Metadata
Assignees
Labels
featureNew feature, enhancement or requestNew feature, enhancement or request