[lint] address new errors introduced by flake8-comprehensions 3.12.0
Summary:
From the doc:
C419 Unnecessary list comprehension in <any/all>() prevents short-circuiting - rewrite as a generator.
Using a list comprehension inside a call to any()/all() prevents short-circuiting when a True / False value is found. The whole list will be constructed before calling any()/all(), potentially wasting work. Rewrite to use a generator expression, which can stop part way.
Another new error code C418 (dict({}) --> {}) is also introduced, but we don't have any instance of it in the codebase.
Test Plan:
pip install flake8-comprehensions --upgrade flake8 . | grep C41[89] cd build && ninja check-functional-extended
Reviewers: #bitcoin_abc, Fabien
Reviewed By: #bitcoin_abc, Fabien
Differential Revision: https://reviews.bitcoinabc.org/D13808