from itertools import groupby
for _, gen in groupby([]):
gen = list(gen)
print(gen)
This wrongly triggers B031 even though the generator is indeed saved to a list as suggested
in the error message. You can make the error go away by assigning to a new variable so
maybe not worth it to track reassignments?
Code to reproduce:
This wrongly triggers B031 even though the generator is indeed saved to a list as suggested in the error message. You can make the error go away by assigning to a new variable so maybe not worth it to track reassignments?