See https://pypi.org/project/flake8-comprehensions/ for a list of rules and examples.
To see the list of errors that this diff fixes, run the following commands (on master):
pip install flake8-comprehensions flake8 --select=C .
Note that in some cases it is required to convert a set/list/dict into a comprehensions (set(int(h, 16) for h in hashes) -> {int(h, 16) for h in hashes}) (error codes C400-404), and in some cases the opposite conversion makes more sense ({h for h in hashes} -> set(hashes)) (C416).
Depends on D13646