Commit cd212d3
committed
Adjust configuration mypy
The strict flag enables the following flags (the precise list
depends on the mypy version, see mypy --help):
--warn-unused-configs,
--disallow-any-generics,
--disallow-subclassing-any,
--disallow-untyped-calls,
--disallow-untyped-defs,
--disallow-incomplete-defs,
--check-untyped-defs,
--disallow-untyped-decorators,
--warn-redundant-casts,
--warn-unused-ignores,
--warn-return-any,
--no-implicit-reexport,
--strict-equality,
--extra-checks
This means mypy accepts the following code as valid:
```
import typing
def ignore_without_code() -> int:
return "a" # type: ignore
def redundant_expr(x: int) -> int:
return 1 if isinstance(x, int) else 2
def possible_undefined(x: int) -> int:
if x > 0:
result = 1
return result
def any_explicit(_x: typing.Any) -> None:
pass
def any_expr() -> None:
a = x # type: ignore[name-defined]
```1 parent 3140291 commit cd212d3
1 file changed
+8
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
28 | 36 | | |
29 | 37 | | |
30 | 38 | | |
0 commit comments