complex-if-statement-in-stub (PYI002)#
Derived from the flake8-pyi linter.
What it does#
Checks for if
statements with complex conditionals in stubs.
Why is this bad?#
Stub files support simple conditionals to test for differences in Python versions and platforms. However, type checkers only understand a limited subset of these conditionals; complex conditionals may result in false positives or false negatives.
Example#
Use instead: