[flake8-bugbear] Skip B905 and B912 if <2 iterables and no starred arguments
#20998
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Closes #20997
This will decrease the number of diagnostics emitted for zip-without-explicit-strict (B905), since previously it triggered on any
zipcall no matter the number of arguments. It may increase the number of diagnostics for map-without-explicit-strict (B912) since it will now trigger on a single starred argument where before it would not. However, the latter rule is inpreviewso this is acceptable.Note - we do not need to make any changes to batched-without-explicit-strict (B911) since that just takes a single iterable.
I am doing this in one PR rather than two because we should keep the behavior of these rules consistent with one another.
For review: apologies for the unreadability of the snapshot for
B905. Unfortunately I saw no way of keeping a small diff and a correct fixture (the fixture labeled a whole block as# Errorwhereas now several in the block became# Ok).Probably simplest to just view the actual snapshot - it's relatively small.