Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛 Update type annotations for show_default parameter and update docs for setting a "Custom default string" #501

Merged
merged 6 commits into from
Mar 23, 2024

Conversation

plannigan
Copy link
Contributor

Fixes #158.

@github-actions
Copy link

📝 Docs preview for commit 5b02ed4 at: https://637303b6be5251630161321e--typertiangolo.netlify.app

@github-actions
Copy link

📝 Docs preview for commit 68a8592 at: https://639ce9cc18290c0ac6ff530c--typertiangolo.netlify.app

@svlandeg svlandeg added bug Something isn't working types Type hints and type checking p2 and removed investigate labels Mar 8, 2024
Copy link
Member

@svlandeg svlandeg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, thanks for the PR!

While we're pretty late to follow up on this, I believe this contribution still makes sense, as the feature is available for typer.Option - it's just not documented or correctly typed.

I hope you don't mind that I pushed to your branch directly to update it with the latest changes from master. I'll also include a new section for the documentation to showcase how this would work in a similar fashion as it does for typer.Argument.

Copy link

📝 Docs preview for commit 2197f6d at: https://ed32ee88.typertiangolo.pages.dev

@plannigan
Copy link
Contributor Author

Not a problem for the assistance in getting this merged.

@tiangolo tiangolo changed the title Expand show_default type hint for Option to include str 🐛 Update type annotations for show_default parameter and update docs for setting a "Custom default string" Mar 23, 2024
@tiangolo
Copy link
Member

Awesome, thanks @plannigan! 🤓

And thanks a lot @svlandeg for the review and tweaks! 🙇

This will be available in Typer 0.9.2 in the next few hours. 🚀

@tiangolo tiangolo merged commit caac29f into fastapi:master Mar 23, 2024
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working p2 types Type hints and type checking
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] Type hint for show_default of typer.Option is incorrect
3 participants