Conversation
Co-authored-by: Andrew Murray <3112309+radarhere@users.noreply.github.com>
| disallow_untyped_calls = false | ||
| enable_error_code = "ignore-without-code" | ||
| extra_checks = true | ||
| follow_imports = "silent" |
There was a problem hiding this comment.
I don't see anything at https://mypy.readthedocs.io/en/stable/command_line.html#cmdoption-mypy-strict that mentions follow_imports? What was the thinking behind changing this?
There was a problem hiding this comment.
That's right, follow_imports is unrelated to --strict. It's just unnecessary to suppress those import errors.
|
The changes here should be re-evaluated after #9414's debate about Python versions is resolved. |
|
Anything I can do to help with that? |
The only thing I can think of is to ask someone at mypy for their official view on whether we need to run mypy against the oldest supported Python, newest Python, or everything in between. |
@JukkaL sorry to bother you, but could I redirect this question to you? |
This configures mypy to run in "strict mode", which according to
mypy --helpenables the following flags:Enabling this caused a bunch of typing errors to surface, which are now also fixed.
Most of these are related to
bytes/bytearray/memoryviewnot being assignable to each other. So I used their common denominator,collections.abc.Buffer, or rather its backport fromtyping_extensions(which is always availableif TYPE_CHECKINGbecause typeshed conveniently lies that it's part of the standard library).