-
-
Notifications
You must be signed in to change notification settings - Fork 170
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
Replace all Optional
with Union
#1095
Conversation
Optional[str]
with Union[str, None]
Not sure what kind of changelog message this should get. Also near midnight here so I'll have to pick this up tomorrow. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #1095 +/- ##
=======================================
Coverage 95.02% 95.02%
=======================================
Files 30 30
Lines 4459 4459
Branches 392 392
=======================================
Hits 4237 4237
Misses 196 196
Partials 26 26
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
I'd say “contrib” since it's improving the readability for contributors w/o any influence on how the type checkers would perceive this. |
Optional[str]
with Union[str, None]
Optional
with Union
Co-authored-by: Sviatoslav Sydorenko (Святослав Сидоренко) <[email protected]>
What do these changes do?
Replace all
Optional
withUnion
We have both in this project:
Optional[int]
onport
andUnion[int, None]
onexplict_port
is not so great. This is a short lived change sincepyupgrade
is going to change them all totype | None
once we remove support for older python.Are there changes in behavior for the user?
no
Related issue number
#1084 (comment)
#1112 (comment)