-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Closed
Labels
needs-designNeeds further design before implementationNeeds further design before implementationruleImplementing or modifying a lint ruleImplementing or modifying a lint rule
Description
A very contrived example but B901 misses yield expressions where they're not the expression of a ExprStmt.
def get_file_paths(file_types: Iterable[str] | None = None) -> Iterable[Path]:
dir_path = Path(".")
if file_types is None:
return dir_path.glob("*")
for file_type in file_types:
(yield a for a in dir_path.glob(f"*.{file_type}"))Note: we should make sure that we don't traverse into any lambda expressions...
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
needs-designNeeds further design before implementationNeeds further design before implementationruleImplementing or modifying a lint ruleImplementing or modifying a lint rule