in-empty-collection (RUF060)
Preview (since 0.11.9) · Related issues · View source
This rule is unstable and in preview. The --preview flag is required for use.
What it does
Checks for membership tests on empty collections (such as list, tuple, set or dict).
Why is this bad?
If the collection is always empty, the check is unnecessary, and can be removed.
Example
Use instead: