Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
#612
the mypy support is very very complicated as everything needs to be typed to not raise an error. On my local machine there are still 237 errors to take care of but I think it's not very meaningful to adress them all here. I would prefer to run it once in a while and reduce them step by step.
Using pre-commit was not possible as the imports are not available without install and pre-commit don't do that: https://github.com/pre-commit/mirrors-mypy#mypy-mirror
I tried my best to keep the previously set values (
None
,""
,False
) and the tests are not complaining so it seems ok.Note that it's impossible to do something like:
And document it as a is not set before the call to
__init__
. That's why I decided to keep all theNone
initialized variables and set them toOptional[xx]
type.For readability, I moved the definition of a class into the
__init__
method to get the hint in the parameters. I don't know yet if I keep the public constructor in the doc or not thoughedit
Cannot go any further as mypy is not supporting
Self
hint yet. python/mypy#14041 will be merged in v0.992