type-comment-in-stub (PYI033)
Added in v0.0.254 · Related issues · View source
Derived from the flake8-pyi linter.
What it does
Checks for the use of type comments (e.g., x = 1 # type: int) in stub
files.
Why is this bad?
Stub (.pyi) files should use type annotations directly, rather
than type comments, even if they're intended to support Python 2, since
stub files are not executed at runtime. The one exception is # type: ignore.
Example
Use instead: