-
Notifications
You must be signed in to change notification settings - Fork 116
Open
Description
For example:
assert (result[i] == expected[i] for i in range(len(expected)))
assert (result[key] == expected[key] for key in result.keys() | expected.keys())bugbear could warn and suggest adding all().
Note that even an empty generator expression is truey:
assert (False for _ in range(0))so it's fine that bugbear doesn't statically know the length of the generator.
There are a couple of similar warnings:
- F631 is a similar rule for
assert <tuple>. - Proposal (2) in Couple new rule suggestions #440 is a similar rule for
assert <constant>.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels