Why this matters
The `__all__` variable should only list valid module attributes. Listing undefined titles can cause `ImportError` when using wildcard imports.
Check if the `__all__` list in a module contains titles that are not defined. Listing undefined titles can cause `ImportError` when performing wildcard imports.
The `__all__` variable should only list valid module attributes. Listing undefined titles can cause `ImportError` when using wildcard imports.
Side-by-side examples engineers can pattern-match during review.
from mymodule import my_func
__all__ = ["unknown_func"] # Noncompliant: "unknown_func" is undefinedfrom mymodule import my_func
__all__ = ["my_func"]from mymodule import my_func
__all__ = ["unknown_func"] # Noncompliant: "unknown_func" is undefinedfrom mymodule import my_func
__all__ = ["my_func"]From the same buckets as this rule.
Check if loops use equality operators (== or !=) in termination conditions. These can lead to infinite loops if the condition is never met exactly. Instead, use relational operators like < or > for safer loop termination.