Derived from the flake8-annotations linter.
What it does#
Checks that function arguments are annotated with a more specific type than
Why is this bad?#
Any is a special type indicating an unconstrained type. When an
expression is annotated with type
Any, type checkers will allow all
operations on it.
It's better to be explicit about the type of an expression, and to use
Any as an "escape hatch" only when it is really needed.
Type aliases are unsupported and can lead to false positives. For example, the following will trigger this rule inadvertently: