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

Fix is_optional(Literal[None]) #323

Merged
merged 1 commit into from
Aug 28, 2024
Merged

Fix is_optional(Literal[None]) #323

merged 1 commit into from
Aug 28, 2024

Conversation

krzentner
Copy link
Contributor

Without this, a field with a type like Literal[None, "a", "b"] may be considered required on some code paths. In particular, when specifying a default for an argument group. Note that this bug is difficult to work around because None | Literal["a", "b"] and Optional[Literal["a", "b"]] result in different (worse) parsing behavior.

Without this, a field with a type like Literal[None, "a", "b"] may be considered required on some code paths.
In particular, when specifying a default for an argument group.
Note that this bug is difficult to work around because None | Literal["a", "b"] and Optional[Literal["a", "b"]] result in different (worse) parsing behavior.
Copy link

codecov bot commented Aug 28, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 86.46%. Comparing base (b6c3346) to head (0ec5f81).
Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #323      +/-   ##
==========================================
+ Coverage   86.44%   86.46%   +0.01%     
==========================================
  Files          34       34              
  Lines        4531     4535       +4     
==========================================
+ Hits         3917     3921       +4     
  Misses        614      614              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@lebrice
Copy link
Owner

lebrice commented Aug 28, 2024

Awesome! Thanks a lot @krzentner !

@lebrice lebrice self-requested a review August 28, 2024 13:44
@lebrice lebrice merged commit ca35a25 into lebrice:master Aug 28, 2024
7 checks passed
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