From fa76daa1a2b728d4676421abd922439eae7b2eaa Mon Sep 17 00:00:00 2001 From: Kropiunig Date: Tue, 16 Jun 2026 01:35:39 +0200 Subject: [PATCH] docs: fix undefined variable in Option default docstring example --- typer/params.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/typer/params.py b/typer/params.py index 833461fa78..9499f27b01 100644 --- a/typer/params.py +++ b/typer/params.py @@ -162,7 +162,7 @@ def main(network: str = typer.Option("CNN")): ``` @app.command() def main(network: Annotated[str, typer.Option()] = "CNN"): - print(f"Hello {name}!") + print(f"Training neural network of type: {network}") ``` You can also use `...` ([Ellipsis](https://docs.python.org/3/library/constants.html#Ellipsis)) as the "default" value to clarify that this is a required CLI option.