-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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(mypy): fix custom Path
and UUID
related types
#2420
fix(mypy): fix custom Path
and UUID
related types
#2420
Conversation
But we have those errors 226: error: Item "str" of "Union[UUID, str]" has no attribute "hex" [union-attr] 227: error: Item "str" of "Union[UUID, str]" has no attribute "hex" [union-attr] 228: error: Item "str" of "Union[Path, str]" has no attribute "absolute" [union-attr] 229: error: Item "str" of "Union[Path, str]" has no attribute "absolute" [union-attr] 230: error: Item "str" of "Union[Path, str]" has no attribute "absolute" [union-attr] 231: error: Item "str" of "Union[Path, str]" has no attribute "absolute" [union-attr]
Codecov Report
@@ Coverage Diff @@
## master #2420 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 25 25
Lines 5080 5080
Branches 1041 1041
=========================================
Hits 5080 5080
Continue to review full report at Codecov.
|
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.
LGTM, @allezxandre are you happy with this fix?
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 good to me!
great thank you. |
my_file_path: FilePath = Path(__file__) | ||
my_file_path_str: FilePath = __file__ # type: ignore | ||
my_dir_path: DirectoryPath = Path('.') | ||
my_dir_path_str: DirectoryPath = '.' # type: ignore |
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.
I guess one day, when we solve koxudaxi/pydantic-pycharm-plugin#36 (comment) we could update the mypy plugin to avoid the need for all these # type: ignore
s
Change Summary
I went a bit too far with #2099 because I was first focused on "accepted" types and not "validated" types.
Related issue number
closes #2418
Checklist
changes/<pull request or issue id>-<github username>.md
file added describing change(see changes/README.md for details)