Skip to content

docs: fix undefined variable in Option default docstring example#1838

Open
Kropiunig wants to merge 1 commit into
fastapi:masterfrom
Kropiunig:docs/fix-option-docstring-example
Open

docs: fix undefined variable in Option default docstring example#1838
Kropiunig wants to merge 1 commit into
fastapi:masterfrom
Kropiunig:docs/fix-option-docstring-example

Conversation

@Kropiunig

Copy link
Copy Markdown

The docstring for the default parameter of typer.Option shows two equivalent examples. The deprecated-style example defines a network parameter and prints {network}, but the recommended Annotated-style example below it keeps the network parameter while printing the undefined variable {name}, which would raise a NameError if run. This corrects the Annotated example to print {network}, making the two examples consistent with each other and matching the equivalent examples in the Argument docstring.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants