-
-
Notifications
You must be signed in to change notification settings - Fork 664
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
📝 Add documentation for enums created via the functional API #398
base: master
Are you sure you want to change the base?
Conversation
📝 Docs preview for commit e3f2d03 at: https://6283788fce83e3109147d75c--typertiangolo.netlify.app |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #398 +/- ##
===========================================
+ Coverage 96.24% 100.00% +3.75%
===========================================
Files 280 252 -28
Lines 5942 5287 -655
===========================================
- Hits 5719 5287 -432
+ Misses 223 0 -223 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great! Hope it gets merged soon.
📝 Docs preview for commit 4fe60e7 at: https://639cea4bf6fa040349687d3f--typertiangolo.netlify.app |
📝 Docs preview for commit 7abe600 at: https://9cea233c.typertiangolo.pages.dev |
📝 Docs preview for commit 4700981 at: https://c89568c3.typertiangolo.pages.dev |
📝 Docs preview for commit b91c009 at: https://52d96a74.typertiangolo.pages.dev |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi! Thanks for this contribution, and apologies for the delay in reviewing.
I agree that this additional section in the documentation could make it more clear for users on how to use "pure" Python Enum
's with Typer.
I updated the PR with the latest from master
and also included an Annotated version.
It's probably good if Tiangolo has another look at the exact phrasing in the documentation. I'll leave the final decision to merge or not with him.
📝 Docs preview for commit acdbc27 at: https://c18a51e0.typertiangolo.pages.dev Modified Pages |
This PR updates the documentation to include discussion of enumerating choices with
enum.Enum
s created with the functional API. This is useful when creating choices dynamically, for example logging.See further discussion of enums and the functional API in #389