-
Notifications
You must be signed in to change notification settings - Fork 3k
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 mypy to 0.720 #6713
Update mypy to 0.720 #6713
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -59,9 +59,9 @@ | |
except ImportError: | ||
# typing's cast() isn't supported in code comments, so we need to | ||
# define a dummy, no-op version. | ||
def cast(typ, val): | ||
def cast(typ, val): # type: ignore | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think we should add There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Also, if you need help finding ways to avoid |
||
return val | ||
VersionInfo = None | ||
VersionInfo = None # type: ignore | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same here. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You could try using the |
||
|
||
|
||
__all__ = ['rmtree', 'display_path', 'backup_dir', | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
mypy == 0.670 | ||
mypy == 0.720 |
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 think a better fix here might be to encode the path to
str
usingsys.getfilesystemencoding()
. Otherwise, we risk getting exceptions in calling code when trying to combinestr
andunicode
if the path has non-ascii characters. As it is now these errors would be hard to prevent by the developer because the type annotation would be showingstr
, so a developer looking at it wouldn't know they have to encode it first.