-
List of keywords you searched for before creating this issue. Write them down here so that others can find this issue more easily and help provide feedback.
B909
-
A minimal code snippet that reproduces the bug.
def __pop_image_type(split_image: Iterable[AutoSplitImage], image_type: ImageType):
for image in split_image:
if image.image_type == image_type:
split_image.remove(image)
return image
return None
- The command you invoked (e.g.,
ruff /path/to/file.py --fix), ideally including the --isolated flag.
ruff check . --isolated --select=B909 --preview
- The current Ruff version (
ruff --version).
ruff 0.5.6
See the reproducer above, I'd expect that to pass, given that the below code also passes, but is much less cleaner:
def __pop_image_type(split_image: list[AutoSplitImage], image_type: ImageType):
for image in split_image:
if image.image_type == image_type:
split_image.remove(image)
break
else:
return None
return image
List of keywords you searched for before creating this issue. Write them down here so that others can find this issue more easily and help provide feedback.
B909
A minimal code snippet that reproduces the bug.
ruff /path/to/file.py --fix), ideally including the--isolatedflag.ruff check . --isolated --select=B909 --previewruff --version).ruff 0.5.6
See the reproducer above, I'd expect that to pass, given that the below code also passes, but is much less cleaner: