-
Notifications
You must be signed in to change notification settings - Fork 915
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 1.3 #13340
Update mypy to 1.3 #13340
Conversation
PEP484 prohibits implicit Optional types, so def bad(x: int = None): pass Is invalid. MyPy since version 0.983 prohibits this usage by default. So rewrite all of the typing (except x : Any = None) using https://github.com/hauntsaninja/no_implicit_optional.
Since the body has type information, the return type needs to be annotated otherwise mypy produces a warning.
This closes issue #13336, right? |
Yes, which I had somehow forgotten I had written as I was making this branch |
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.
One question and one suggestion, but generally LGTM. All the Optional changes seem fine.
/merge |
@wence- Huge thanks for this. This update will make it easier to keep other pre-commit hooks updated on a semi-regular basis with |
Description
Bring us up to date with the current mypy release. Big diff, mostly due to the no-implicit-optional rule that mypy now enforces (see commit message of 040f577 for details). That commit is automated so probably best to review commit-by-commit for the substantive changes.
Checklist